Package: sensible-utils
Version: 0.0.26
Severity: wishlist
File: /usr/bin/sensible-terminal

sensible-terminal was mentioned in a recent discussion on Policy issue 
#1136306, regarding a proposed wayland-terminal-emulator virtual 
package.

xdg-terminal-exec is a reference implementation of a proposed 
freedesktop.org spec for starting a terminal emulator, which has several 
advantages over sensible-terminal:

* It isn't Debian-specific, meaning that upstream software is more
  likely to support it without Debian-specific patches. To be useful,
  an abstraction like this needs to be supported by providers (terminal
  emulators), consumers (applications and libraries that want to start a
  terminal emulator), and configuration UIs (gnome-control-center,
  KDE's systemsettings, and their equivalents in other desktops).

* It can cope with terminal emulators that don't have an
  xterm-compatible "-e" argument. Notably this includes gnome-terminal,
  which wants to be invoked as "gnome-terminal -- COMMAND ARGS..." as its
  equivalent of "xterm -e COMMAND ARGS..." so that it can use normal
  GNU-style command-line parsing.

* It can be configured on a per-user basis by writing files into
  $XDG_CONFIG_HOME, without needing to set new tool-specific environment
  variables like $TERMINAL_EMULATOR or $SENSIBLE_TERMINAL_EMULATOR.
  This is important for two reasons:

  - Because of how environment variables inherit from parent to child,
    setting an environment variable can't be "instant-apply": after
    changing it, the user has to terminate all processes that already
    inherited it (in practice, log out and log back in, or reboot).

  - There's no universal, declarative way to set an environment variable
    for all login sessions, which UIs like gnome-control-center and
    systemsettings would need if they wanted to make this configurable.
    The closest I'm aware of is environment.d(5), which I think only
    systemd implements (although I would encourage non-systemd session
    managers to implement it too, because it's a completely reasonable
    non-systemd-specific spec).

Unfortunately the configuration design that xdg-terminal-exec implements 
has not been published as a formal spec by freedesktop.org, but it's the 
best thing we have available right now. It's modelled on the way that 
fdo MIME-type handlers and URI scheme handlers are registered, which 
gives it a lot of good properties "for free", like desktop-specific 
defaults, per-user configuration, and a design where per-user 
configuration can be instant-apply.

It's possible that freedesktop.org will end up recommending that 
terminals are registered via the more general Intent Apps spec 
<https://specifications.freedesktop.org/intent-apps/latest/>. If it 
does, then I would expect xdg-terminal-exec to switch to using that, 
plus backward compatibility to its previous draft spec.

I'm not sure that a Debian-specific sensible-terminal is a good thing to 
have, but since we do already have it and removing it would be a 
compatibility break, I think it should delegate to xdg-terminal-exec 
when available. I'd suggest that xdg-terminal-exec should be higher 
priority than sensible-terminal-$desktop or x-terminal-emulator, but 
perhaps lower priority than $TERMINAL_EMULATOR or 
$SENSIBLE_TERMINAL_EMULATOR.

Thanks,
    smcv

Reply via email to