Is it possible to define which terminal will be used for desktop-file with `Terminal=true` (Application in Terminal) set?

I have two laptops with almost similar settings inside Ubuntu MATE 16.04 LTS.
But there is a difference in the behavior of desktop-files with set Terminal=true.

The example file is generated by right mouse click and selecting Create Launcher...:

htop

this results in file with the following contents:

$ cat htop.desktop 
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Icon[en_US]=htop
Name[en_US]=htop
Exec=htop
Comment[en_US]=htop
Name=htop
Comment=htop
Icon=htop

The 1st laptop with clean installation of Ubuntu MATE 16.04 LTS shows htop in xterm. Here is the debug

$ sudo update-alternatives --config x-terminal-emulator`is the  following:
There are 5 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator).

  Selection    Path                            Priority   Status
------------------------------------------------------------
* 0            /usr/bin/mate-terminal.wrapper   30        auto mode
  1            /usr/bin/koi8rxterm              20        manual mode
  2            /usr/bin/lxterm                  30        manual mode
  3            /usr/bin/mate-terminal.wrapper   30        manual mode
  4            /usr/bin/uxterm                  20        manual mode
  5            /usr/bin/xterm                   20        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

$ gsettings list-recursively | grep -E "mate-terminal|gnome-terminal|xterm"
org.mate.applications-terminal exec 'mate-terminal'

The 2nd laptop have GNOME Terminal previously installed and then htop is shown in gnome-terminal. The output:

$ sudo update-alternatives --config x-terminal-emulator 
[sudo] password for norbert: 
There are 9 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator).

  Selection    Path                             Priority   Status
------------------------------------------------------------
  0            /usr/bin/terminator               50        auto mode
  1            /usr/bin/gnome-terminal.wrapper   40        manual mode
  2            /usr/bin/guake                    40        manual mode
  3            /usr/bin/koi8rxterm               20        manual mode
  4            /usr/bin/konsole                  40        manual mode
  5            /usr/bin/lxterm                   30        manual mode
* 6            /usr/bin/mate-terminal.wrapper    30        manual mode
  7            /usr/bin/terminator               50        manual mode
  8            /usr/bin/uxterm                   20        manual mode
  9            /usr/bin/xterm                    20        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

$ gsettings list-recursively | grep -E "mate-terminal|gnome-terminal|xterm"
org.gnome.finalterm emulated-terminal 'xterm-256color'
org.mate.applications-terminal exec 'mate-terminal'

I have invented a hack with creating symlink between GNOME Terminal and MATE Terminal:

sudo ln -s /usr/bin/mate-terminal /usr/local/bin/gnome-terminal

but it is ugly.


What should I do with 1st clean installed machine to use MATE Terminal by default for desktop-file with Terminal=true set? Is it a bug or feature?


Note: 18.04 LTS and 19.04 are also affected by this problem (?), but the upcoming Ubuntu 19.10 uses MATE Terminal for such cases and it is great.

1 Like