Open in Terminal: choose which terminal application to open

Hey everyone,

I opened a new issue here about this:

Essentially I want to be able to customize the command that runs when “Open in Terminal” is selected in nautilus. Would love to hear feedback/suggestions, thanks!

The option to set which terminal to use is already addressed by added support for xdg-terminal-exec in GLib: 'Run in terminal' should use the preferred terminal (#338) · Issues · GNOME / GLib · GitLab

Nautilus uses that Edit: I was wrong, Nautilus does not use this for open in terminal. through the hard-coded list of terminals in GLib. xdg-terminal-exec is at the top so if you have xdg-terminal-exec installed you can configure with the file ~/.config/xdg-terminals.list which terminal you want GLib using apps to use.

If you have a recent GNOME release you likely already have that file as for example GNOME Terminal creates it when in Edit > Preferences > General the user has opted to make GNOME Terminal the default:


Thanks for your response. I’m unsure of how to properly use xdg-terminal-exec. Here’s my setup:

As you can see, I have xdg-terminal-exec on my $PATH, and I also prepended /usr/bin/kitty (and kitty for good measure) into my ~/.config/xdg-terminals.list`.

Unfortunately, when selecting “Open in Terminal” in Nautilus, it still opens in gnome-terminal. Any ideas? Does it look like I maybe didn’t configure xdg-terminal-exec properly? Thanks!

It should be kitty.desktop instead of /usr/bin/kitty or kitty and /usr/share/xdg-terminals/kitty.desktop should exist (as a symbolic link to ../applications/kitty.desktop). Use the filename of the .desktop file of the terminal app. It’s a bit more involved than I imagined because terminals other than GNOME Terminal are not yet following the xdg-terminal-exec specification.

The “Open in Terminal” option in Nautilus is provided by a Nautilus extension that is part of gnome-terminal and is only capable of launching gnome-terminal. It does not use the glib API that would consider xdg-terminal-exec.

There are different Nautilus extensions that allow starting arbitrary terminals, like GitHub - Stunkymonkey/nautilus-open-any-terminal.

1 Like

Apologies, I got things crossed and sent you down a rabbit hole :frowning: Nautilus “open in terminal” does not use xdg-terminal-exec yet.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.