Spec to define the default terminal?
Thomas Gläßle
t_glaessle at gmx.de
Tue Oct 20 03:23:01 PDT 2015
Hello freedesktop.org,
This is a follow up on a bug to xdg-utils about xdg-open not spawning
terminals for .desktop files with Terminal=true entry [1]. Rex Dieter
suggested to start a discussion here before taking further steps.
[1] https://bugs.freedesktop.org/show_bug.cgi?id=92514
To summarize the issue:
There is currently no uniform way to set the default terminal across the
system and so everyone seems to be doing their own thing:
- xdg-open does not know how to spawn terminals (leading to the
application aborting or even worse: suppressed output)
- mimeopen uses an environment variable $TERMINAL in the form
TERMINAL="xterm -e"
- rifle (file opener, part of the ranger file manager) uses an
environment variable $TERMCMD in the form TERMCMD="xterm"
- in awesome (window manager), you usually configure the terminal in
your lua.rc file
- not sure what desktop environments are doing in their code base, maybe
hardcoding their own terminals
- xdg-terminal (unreleased, part of xdg-utils) currently even looks at
$TERM and uses xterm as hardcoded fallback
- probably tons of others...
In the thread attached to the bug report we had several (not necessarily
exclusive) thoughts about how to tackle the issue:
1 a) invent a new variable e.g. $TERMINAL or similar that works like
$BROWSER, i.e. something of the form TERMINAL=urxvt:gnome-terminal:xterm
1 b) invent a new variable e.g. $TERMINAL or similar that works like the
one used by mimeopen, i.e. TERMINAL="xterm -e"
2) encourage the use of (and possibly semi-mandatory dependency on)
gvfs-open/kde-open
3). invent a mimetype for terminal applications so available terminals
can be iterated via .desktop files and a default can be requested in the
mimeapps.list file, e.g.:
[Desktop Entry]
name=terminator
GenericName=X Terminal Emulator
Exec=terminator -x %F
MimeType=x-terminal-emulator
My personal opinions:
concerning 1 a)
- [+] nice and simple
- [-] have to hardcode command line options, e.g. terminator uses "-x"
rather than "-e"
- considering $TERMINAL is already used in a different fashion by
mimeopen (and mimeopen is used as fallback by xdg-open), I'd rather tend
towards a different name for the variable, e.g. $TERMCMD which would be
upward compatible to how its used by terminator
concerning 1 b)
- [+] no need to hardcode command line options
- [+] compatible with existing mimeopen behaviour
- [-] contains more than just a executable name, may be less simple to
analyze
concerning 2)
- [+] easy out without much coding for xdg-open
- [-] doesn't really solve the problem that "everyone uses their own
mechanism"
- [-] I didn't look at gvfs-open/kde-open so far, but I'm afraid, they
don't allow the user to specify their preferred terminal as easily
- [-] seems like a heavy dependency
concerning 3)
- [+] uses an established config format
- [+] can configure multiple terminals with correct command line
options and the default
- [-] not sure if the mimetype concept applies to this problem very well
- [-] maybe too complex for such a simple goal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/xdg/attachments/20151020/50be5466/attachment.sig>
More information about the xdg
mailing list