Fedora, Terminal and alternatives

Context: During this post, the term alternatives refers to the tool called alternatives.

So whats the deal with Fedora and how it (or in this case: does not) handles Terminals?

In my previous life with Ubuntu, the OS was configured to have a default Terminal application which initially pointed to the gnome-terminal app, which then could be changed by using the command

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

So after checking if alternatives is even installed, I went on trying the same on Fedora, only to find out, that Fedora does not even define a default application for Terminal:

 ~ alternatives --list
libnssckbi.so.x86_64    auto    /usr/lib64/pkcs11/p11-kit-trust.so
soelim                  manual  /usr/bin/soelim.groff
arptables               auto    /usr/sbin/arptables-nft
ebtables                auto    /usr/sbin/ebtables-nft
man                     auto    /usr/bin/man.man-db
print                   auto    /usr/bin/lpr.cups
cups_backend_smb        auto    /usr/bin/smbspool
cifs-idmap-plugin       auto    /usr/lib64/cifs-utils/cifs_idmap_sss.so
iptables                auto    /usr/sbin/iptables-nft
qtchooser-5             auto    /etc/xdg/qtchooser/5-64.conf
google-chrome           auto    /usr/bin/google-chrome-stable
qtchooser-default       auto    /etc/xdg/qtchooser/5.conf
xinputrc                auto    /etc/X11/xinit/xinput.d/ibus.conf

Kinda surprising. Even the official docs mention alternatives but ignores Terminal Looking into /usr/share/applications/org.gnome.Terminal.desktop, it correctly advertises itself through the categories:

...
Exec=gnome-terminal
Icon=org.gnome.Terminal
Type=Application
Categories=GNOME;GTK;System;TerminalEmulator;           <---- TerminalEmulator
StartupNotify=true
StartupWMClass=Gnome-terminal
SingleMainWindow=false
...

Looking into the .desktop entry for the app I want to have as the default defines also TerminalEmulator, so technically, there should be no issues.

So the question comes up, why the users are not given the choice to change their default Terminals?

Sure, one can just define / change the shortcut to point it to the new app, but this is not the same as defining a default. e.g. when other applications decide to open a terminal, or you want to exec.run scripts from a File Manager, right-click open in Terminal…, etc… Then the “hardcoded” gnome-terminal will be used…

Workarounds

Some research on how to switch the default terminal app in Fedora suggested changing the gsettings, but one is presented with the following message:

My current approach is a ‘simple solution’ (quotes, because it is still a workaround!) to create a symlink of your app to /usr/local/bin/ with the file name gnome-terminal and making use of the lookup precedence, while still keeping /usr/bin/gnome-terminal

sudo ln -s $(command -v <YOUR_APP>) /usr/local/bin/gnome-terminal

Now whenever something / someone exec’s gnome-terminal, the system will first look in the entry in /usr/local/bin before the other locations and use that one…

Following questions: (ANSWERED)

  • (depr.) Why are users not given the choice of changing the default terminal app? This question would make sense, if a default would have been defined at all, which leads to:
  • Why is Fedora lacking the definition of a default terminal application like other distros? Is this how vanilla Gnomes comes with and Fedora did / does not want to decide on this?
    Basically yes, this is See answer below with links
  • Do you know ‘better’ solutions to still change/define a default terminal?
    Not sure if really better, but at least what Gnome expects… see also reply from @vgaetera (thanks for that!)
  • In case Question 2 is true, maybe it is worth asking this question towards Gnome? Considering there are now three different projects in their ecosystem, this would even make more sense without even thinking about 3rd party terminals, right? (Terminal, Konsole, Prompt)
    Yep, the Gnome Project itself is not clear about how to progress on this…
2 Likes

Added alternatives, gnome-terminal

This can be closed. Was not aware of the absurd drama that is going on at the Gnome Project regarding this topic. For reference:

Depending upon the shell preferred by each user, fedora has defaults configured. For Workstation with gnome that is gnome-terminal with the bash shell, but may be different for users who prefer a different shell or who are using a different fedora spin (DE).

If a user wants a different terminal app they have the choice to install and use whatever is available, it just is not widely publicised as available. Most are quite content with the default.

To see the available terminals that the user may choose, simply run the command dnf list \*terminal\* and you will find about 20 or more choices that a user can install and configure as their default. Some are designed for use with specific DE environments and some aren’t.

The fact that the default terminal is set as gnome-terminal for Workstation fits right in with gnome as the DE and bash as the shell, though nothing in that respect is locked in, merely set as default.

Not sure if you even read the content of the post. This is not about how to use dnf to search for and install software.

The question is how to change the default terminal application for Gnome. Telling the gnome-terminal is a good candidate because it fits into the Gnome DE does also makes no sense.

  1. As already mentioned, even the Gnome project itself is currently having three different terminals.
  2. If Fedora configures defaults, then why it is possible to change the default Browser application in the settings? Or the default mail application? Or even the default media player? But not for the Terminal?

Following the links you mentioned, it works like this:

sudo alternatives --install /usr/local/bin/xdg-terminal-exec \
    xdg-terminal-exec $(type -P kgx) 200
sudo alternatives --install /usr/local/bin/xdg-terminal-exec \
    xdg-terminal-exec $(type -P gnome-terminal) 300
sudo alternatives --auto xdg-terminal-exec
sudo alternatives --display xdg-terminal-exec

Although this way is not quite user-friendly as it lacks GUI support.

3 Likes

Hey @vgaetera thanks for the example!

Although this way is not quite user-friendly as it lacks GUI support.

And yes, I am totally with you on this, not only the lacking GUI support, but also the xdg-terminal-exec approach is kinda messy and awful…

I updated my questions and also think this needs some clarification in the Gnome Project and not to be solved by Fedora.

1 Like