You are not logged in.

#1 2018-07-16 10:02:45

laelath
Member
Registered: 2018-07-16
Posts: 5

xdg-open with terminal applications and glib/gio only opening in xterm

Using xdg-open or using a file manager to run a terminal program only opens it in xterm. If xterm is uninstalled then xdg-open exits with a gio error, and the file manager does nothing. Is there a way to tell gio what terminal emulator I want to use, as the dconf setting seems to be ignored now. This is using i3 and no desktop environment.

Last edited by laelath (2018-07-16 10:06:00)

Offline

#2 2018-07-16 11:40:24

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: xdg-open with terminal applications and glib/gio only opening in xterm

try exporting terminal in your .bashrc

export TERMINAL=<your terminal>

Offline

#3 2018-07-16 15:32:48

laelath
Member
Registered: 2018-07-16
Posts: 5

Re: xdg-open with terminal applications and glib/gio only opening in xterm

I forgot to mention that. TERMINAL was already set and seems to also be ignored by glib

Offline

#4 2018-07-16 15:36:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: xdg-open with terminal applications and glib/gio only opening in xterm

Exporting TERMINAL from bashrc will most likely not have any effect.  Environment variables are not global variables.

How do you start i3?  Is TERMINAL set and exported prior to i3 starting?  More specifically, it needs to be set and exported in a parent process of the file manager you are using, but I'd suspect your file manager is launched from i3, correct (e.g., via a key binding).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2018-07-16 15:42:56

laelath
Member
Registered: 2018-07-16
Posts: 5

Re: xdg-open with terminal applications and glib/gio only opening in xterm

I run i3 using startx. I just checked and TERMINAL is set before i3 is launched.

Offline

#6 2018-07-16 15:52:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: xdg-open with terminal applications and glib/gio only opening in xterm

Do you type startx directly, or do you autostart X from a shellrc file?  Post the relevant configs/rc files.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2018-07-16 16:05:33

laelath
Member
Registered: 2018-07-16
Posts: 5

Re: xdg-open with terminal applications and glib/gio only opening in xterm

I use fish for my shell, which launches startx on login. Here's the relevant parts of my config.fish. The TERMINAL variable is set and exported in the fish variable database.

if status --is-login
    set PATH $PATH ~/Sync/Scripts
end

# ...Aliases and custom functions...

if status --is-login
    if test -z "$DISPLAY" -a $XDG_VTNR = 1
        exec startx -- -keeptty
    end
end

Offline

#8 2018-07-16 18:38:40

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: xdg-open with terminal applications and glib/gio only opening in xterm

laelath wrote:

The TERMINAL variable is set and exported in the fish variable database.

Where?  There's no such thing in that file.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2018-07-16 18:43:08

laelath
Member
Registered: 2018-07-16
Posts: 5

Re: xdg-open with terminal applications and glib/gio only opening in xterm

It's in .config/fish/fishd.****** if you use set -Ux

# This file is automatically generated by the fish.
# Do NOT edit it directly, your changes will be overwritten.
SET_EXPORT GDK_SCALE:2
SET_EXPORT TERMINAL:miniterm
SET __fish_init_2_39_8:\x1d
SET __fish_init_2_3_0:\x1d
# ... color settings ...

Offline

#10 2018-07-16 18:53:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: xdg-open with terminal applications and glib/gio only opening in xterm

I'm not familiar enough with fish to know how any of that works - but it seems needlessly complex.  And I note the "if you use set -Ux", I do not see "set -Ux" anywhere in your code that starts X.

Just test it, add `export TERMINAL=miniterm` directly before the `exec startx ...` line.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2018-07-16 19:16:22

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: xdg-open with terminal applications and glib/gio only opening in xterm

Let's see what reaches i3…

tr '\0' '\n' < /proc/`pidof i3`/environ | grep TERM

Offline

#12 2018-07-21 09:05:56

justasug
Member
Registered: 2014-08-03
Posts: 165

Re: xdg-open with terminal applications and glib/gio only opening in xterm

Is it related to the specific mentioning of terminal emulators in Gio? See this https://gitlab.gnome.org/GNOME/glib/blo … fo.c#L2498

I had a similar problem and I solved it by symlinking gnome-terminal to my preferred terminal emulator.

Offline

#13 2018-07-21 09:56:34

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: xdg-open with terminal applications and glib/gio only opening in xterm

justasug wrote:

Is it related to the specific mentioning of terminal emulators in Gio? See this https://gitlab.gnome.org/GNOME/glib/blo … fo.c#L2498

I had a similar problem and I solved it by symlinking gnome-terminal to my preferred terminal emulator.

Better symlink "nxterm" instead. Gio uses -x instead of -e for gnome-terminal and I believe not many terminals support that.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#14 2018-10-19 10:34:37

frebib
Member
Registered: 2018-04-07
Posts: 3

Re: xdg-open with terminal applications and glib/gio only opening in xterm

Wouldn't a better solution be to submit a patch that allows external configuration of the terminal used? I feel like it is a massive oversight that the terminal emulators are hard-coded

Offline

#15 2018-10-19 10:55:25

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: xdg-open with terminal applications and glib/gio only opening in xterm

frebib wrote:

Wouldn't a better solution be to submit a patch that allows external configuration of the terminal used? I feel like it is a massive oversight that the terminal emulators are hard-coded

Have fun. GNOME developers feel that defining a standardized name for a symlink is the same hacky solution as simply symlinking nxterm, so a patch for that won't be accepted. And adding a dependency on dconf would introduce a cirular dependency, and is overkill for such a small setting.

https://gitlab.gnome.org/GNOME/glib/merge_requests/255
https://gitlab.gnome.org/GNOME/glib/issues/338


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#16 2018-10-19 13:51:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: xdg-open with terminal applications and glib/gio only opening in xterm

And setting TERMINAL is trivially easy.  It just needs to be set in (and exported from) a parent process of xdg-open.  There is not yet evidence in this thread that this has been done.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#17 2018-10-19 14:24:34

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: xdg-open with terminal applications and glib/gio only opening in xterm

https://gitlab.gnome.org/GNOME/glib/blo … fo.c#L2466 does not indicate interpretation of that variable.

Offline

#18 2018-10-19 14:48:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: xdg-open with terminal applications and glib/gio only opening in xterm

Oops - sorry for the noise.  I was misled by the start of the thread.  I'm pretty sure xdg-open used to use an environment variable, but the script has changed quite a bit since I last looked at it.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB