Gnome-terminal or nautilus disrespects xdg-terminal-exec

I’ve installed xdg-terminal-exec in order to try to get nautilus (Gnome Files) to launch a terminal other than gnome-terminal (org.gnome.Terminal.desktop file), in my case, ptyxis (org.gnome.Ptyxis.desktop file).

Unfortunately, it seems that the “default” nautilus extension, which I believe is owned by gnome-terminal, overwrites xdg-terminals.list file and GNOME-xdg-terminals.list file. Now, I don’t even think the latter file should necessarily exist, as it only adds to the confusion already at play here. The whole point of XDG is to be able to standardize everything. I think that:

  1. xdg-terminal-exec needs to be ready for prime time. I shouldn’t have to go to the AUR to install it
  2. Open in terminal should be default, not an extension implemented to varying success by distro maintainers or by terminals themselves, which may be biased against other terminals
  3. I shouln’t have to edit a configuration file to change this anyway. I should be able to go to Settings > Apps > Default Apps and change my default terminal app graphically by default in modern GNOME.
  4. If I do edit the configuration file, nautilus, gnome-terminal, and glib/gio should NEVER quietly overwrite it. I don’t know who to blame in this case but it’s clear something in the GNOME extended-family has made a mistake.

I’ve tried so many things and as a user and a newbie, I really don’t think making changes like this should be that hard. I’ve tried installing a script from the AUR to called nautilus-open-in-ptyxis but not only was it broken due to only checking /bin/ instead of /usr/bin (i made a pull request) but the code was riddled with typos and I wasn’t sure keeping it installed was the best choice, especially since it just added another menu option instead of fixing the existing one.

That’s why I decided to instead install xdg-terminal-exec-git. I was lead to this idea by source code in the GNOME GitLab.

Now, the AUR version of xdg-terminal-exec seemed to be installed by only maybe three people based on the statistics, but I found many people who have been having a similar issue on Reddit, so I think it’s one of those things that’s best installed by default without the user really noticing or worrying about it once it works. Unfortunately, it doesn’t work because it gets overwritten. Also, most of the Reddit advice was to install a different extension.

I would like to fix the problem but I am a newb and don’t even know which source code to search through to find the problem and much of it is difficult to understand. But HERE IS THE BIG PROOF MY CONFIG IS BEING OVERWRITTEN INSTEAD OF BEING USED.

==> BEFORE <==

==> AFTER <==


As you can see, not only does my terminal preference appear to be ignored, but it is also apparently overwritten by nautlius, a nautilus extension, gnome-terminal, or glib in some way (I don’t know why or how). There is no warning about this issued by nautilus when I run it from the command line, either, which I find very confusing and disrespectful toward the XDG configuration. Sorry if this is in the “wrong topic” I am new here and am willing to move/delete the conversation if necessary. Just point me in the right direction because I’ve had this dissatisfaction with the open-in-terminal on popular distros like Ubuntu/Fedora/Arch for years now…

EDIT: To be clear I am not trying to create drama by accusing a terminal or extension of malicious intent. It may be that they only tested it on their own terminal and not on other terminals that should be compatible. That is what is meant by “biased toward their own terminal” (not against other terminals).

1 Like

xdg-terminal-exec is only a proposed specification (despite the ‘xdg’ prefix, it hasn’t been endorsed or adopted by freedesktop.org). The extent of GLib’s support for it is that it looks for an executable in PATH with that name. In practice, this is probably more useful with a custom wrapper script, rather than the 1200-line reference implementation shell script:

$ cat ~/.local/bin/xdg-terminal-exec 
#!/bin/bash
exec ptyxis -- "$@"

However, I’ve just discovered that gnome-terminal actually does have support for that spec, and it is almost certainly what is rearranging the list in order to set itself as default.

There may be a bug in the code that checks the validity of the existing default. (It seems wrong that xte_data_check() looks at a hardcoded list of directories instead of honoring XDG_DATA_DIRS.) I doubt there are many users who would notice. You can open an issue; including the debug output would be helpful, but that will require rebuilding gnome-terminal with debugging enabled.


To be clear, all of the above is only used by GLib for Terminal=true desktop entries. Nautilus is entirely separate. For that, you can use nautilus-open-any-terminal.

I agree that this isn’t a great state of affairs, but writing in all caps isn’t going to help change it.

2 Likes