3

I want to change the default terminal in the GNOME desktop environment to lilyterm. Here are the instructions that I've found on the internet:

gsettings set org.gnome.desktop.default-applications.terminal exec lilyterm
gsettings set org.gnome.desktop.default-applications.terminal exec-arg ""

But when I'm pressing the shortcut that should run the default terminal, I'm getting:

Windows manager warning: Error on terminal command"(null)". Terminal command is not defined.

Where have I made a mistake?

5 Answers 5

12

Have you tried changing it via the Terminal command:

sudo update-alternatives --config x-terminal-emulator

I guess this does not help if the GNOME shortcut is set specifically to gnome-terminal instead of x-terminal-emulator.

10

Most of the answers here are outdated for today's Gnome software. For Gnome 3.36 there's no easy workaround. The problem lies in the fact that most Gnome software is based on Gio which it decides what terminal emulator to use eventually. Quoting a Gnome developer from gitlab.gnome.org:

The decision which terminal is going to be used by gnome-shell when starting apps that specify that they run in a terminal is made by glib and not gnome-shell and currently in glib there is a hardcoded list of terminals that is being tried).

Hence, looking e.g at Gio's (version 2.76.2) code responsible for this behavior, we can see that Gio has hard coded the tests for several specific terminal emulators' executables search in $PATH. xdg-terminal-exec is tested there first and other terminal emulators are tested further. If xdg-terminal-exec is found in your $PATH, it will be used and there's nothing one can do, besides altering the programs in your $PATH:

# ln -s /usr/bin/lilyterm /usr/bin/xdg-terminal-exec

This also means that the most widely solution to this problem, using gsettings, doesn't work (also proposed here: 1, 2, 3, 4, 5).

5
  • As of gnome 3.36.8 (Ubuntu 20.04.8) this solution doesnt work either. Nautilus keeps opening gnome-terminal. I tried update-alternatives + creating a symlink to the terminal I want to launch when right-clicking -> Open In Terminal. update-alternatives only changes the behavior of Ctrl-Alt-T. That really sucks. Feb 16, 2022 at 6:40
  • Here on NixOS, with gnome 41.2, and nautilus 41.1, I don't even see anymore the "open terminal" button. Feb 18, 2022 at 11:12
  • 2
    @DanielBişar, @DoronBehar For Nautilus, you will have to uninstall nautilus-extension-gnome-terminal plugin, and then instead install the nautilus-open-any-terminal plugin.
    – A S
    May 26, 2022 at 3:41
  • 1
    @DoronBehar apparently, there has been some development in this area, and (per your link to the bugzilla) GNOME will support the xdg-terminal-exec utility going forward. May be interesting to revise your answer in a couple of months, if xdg-terminal-exec should become part of the freedesktop standard. +1 for the comprehensive (and most up to date) answer though
    – Fynn
    Apr 30, 2023 at 11:54
  • Thanks for noticing @Fynn. I update the links and I updated the ln command to use xdg-terminal-exec. May 1, 2023 at 19:25
2

There are a few options:

  • Try with:

    gsettings set org.gnome.desktop.default-applications.terminal exec 'lilyterm'
    gsettings set org.gnome.desktop.default-applications.terminal exec-arg '-x'
    

    Note: You need to log out and log in again (tested succesfully on GNOME on Ubuntu 13.04).

  • Another possibility is to go to Shortcuts in GNOME Settings and add a new one with lilyterm as command, and set it to Ctrl+Alt+T or anything else you prefer.

  • Another way is to replace gnome-terminal with a symlink that points to lilyterm - but you don't want to do that.

6
  • 1
    Still equal error message. Mar 9, 2012 at 21:10
  • I modified the answer, please check this.
    – dadexix86
    Mar 9, 2012 at 21:17
  • 1
    Nothing changes :(. In my opinion, such error message indicates, that desktop.default-applications.terminal and Default Terminal in shortcut settings is different things. Mar 9, 2012 at 21:34
  • Have tou tried to logout-login after changing the settings? I think that gconf should be updated with this new gsettings configurations.
    – dadexix86
    Mar 9, 2012 at 23:00
  • @dadexix86less yes, I have. Mar 9, 2012 at 23:14
1

I just accidentally bumped into this question and this what worked for me:

  1. Check which terminal is left in your system. I had already removed all "terminal apps" such as xterm etc and chose rxvt-unicode as default terminal.

  2. Then go to Settings → Keyboard Shortcuts and create a custom shortcut. It will do the trick for you.

0

Perhaps you should open the add/edit users dialogue and see if you can change the default terminal there.

Updated: Users & Groups (as admin) > Select User > Advanced Settings > Advanced > Shell

There is a drop down menu, but you can also type out /path/to/your/shell.

1
  • 1
    This is talking about terminal emulators, not shells. May 4, 2012 at 0:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .