Right click menu in directory - "open in terminal" - only opens GNOME default terminal

This is one of those quality-of-life issues, that I’m bamboozled doesn’t have an easier way to configure already.

I know very few Linux users who are using the default GNOME (I think it’s Nautilus) terminal. We’re all installing Warp, or Kitty, or Terminator, or something.

But when you’re in a directory, and right click - “open in terminal” - it always opens the pre-installed terminal. Even if you set the default terminal to a different terminal emulator, the right click - “open in terminal” - doesn’t open what you’ve set as the new default terminal emulator.

So, I ended up using this repo: GitHub - Stunkymonkey/nautilus-open-any-terminal , and it worked, but it gave me TWO ENTRIES in the right click menu for - “open in warp”. My OCD kicked in, and because I only use progressive webapps, I just reinstalled Fedora (it’s a 15 min process for me).

But now that I’ve reinstalled, nautilus-open-any-terminal isn’t working. I have no clue why. It’s above my paygrade.

But it begs the question: Why can’t I just set a system wide default terminal emulator - that opens when I right click and select “open in terminal” - or otherwise edit the right-click menu, so that I can add it myself?

You KNOW that we’re all using a variety of terminals. Right click - “open in terminal” - should ALREADY open our terminal of choice. Hell, add into “default apps” as a dropdown choice.

I’ve wished for this for a while. Having it in the default apps and having a keyboard shortcut like we have for Email and Web Browser makes a lot of sense to me. I have to set up a custom keyboard shortcut for it every time I install Fedora.

I think Calculator might have the same issue - it’s not in Default Apps but it is in keyboard shortcuts. Possibly hard-coded there?

Because it’s… complicated.

I’m not joking. I originally thought this should be easy. Until I found out it’s not. It’s one of those things that should be simple and obvious but somehow, in more than 20 years, hasn’t been solved.

Good news is there are some efforts on this matter, with at least two possible solutions emerging.

So, hopefully we may see the case closed in the near future.

(Source: I am a maintainer of the Files app and I too wish people didn’t have to install extensions to open folders in their terminal of choice.)

1 Like

I brought up this “default apps” issue a few days ago for the default camera app for mobile devices / desktop, and they let me know that there is only a place for “default apps” if they are related to a MIME type or URL.

But, applications such as GNOME Builder do have hardcoded “default” apps, and so does Nautilus, where they will open GNOME apps (builder opens Epiphany if you click on a link on the terminal, Nautilus “Open with Terminal” opens GNOME Terminal, etc.)

That’s not what happens in my experience. It opens the default web browser, as set in Settings→Default Applications.

But otherwise you are spot on: the non-obvious difference between the concept of a “default terminal” and the other default apps is that it’s not about setting the default for a type of file or for a type of URL.

There is no generic way to “open in terminal” that all terminal apps support. Therefore, picking a default terminal app is useless at the moment.

The nautilus-open-any-terminal extension hardcodes individual invocation command lines for a set of terminal apps it supports. That’s not a sustainable solution. But it’s the only possible workaround at this time.

I wanted to update about the link I first linked: Stunkymonkey/nautilus-open-any-terminal.

The reason I ended up with two right-click menu entries, is because the instructions on GitHub have the code for both “a system-wide install” and “a user-local install” written in the same codeblocks, with the relative commands in a different order, in subsequent codeblocks. Obv. my fault, but still kinda WTF?

The proper way to install - let’s be safe, at the user level - is:

sudo dnf install nautilus-python

pip install --user nautilus-open-any-terminal

glib-compile-schemas ~/.local/share/glib-2.0/schemas/

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal terminal <name of terminal>

However, I suspect that REMOVING the entry won’t be so easy, if you decide to switch to Kitty, or Warp, or Terminator; you might end up with a few extra entries.

I’m sure someone smarter than I can figure out how to remove entries, but last time I tried - I broke my Fedora installation. Not a big deal for me since I’m a webdev who primarily uses webapps (I have maybe 3 native apps installed). But definitely not something your average user would want to do.

Luckily, I have no intention of using anything but GNOME-terminal and Warp. So I’m just going to leave it as is, and never touch it again.

EDIT: First edit was “python-nautilus” to “nautilus-python”. Second edit: The “pip install” will ask you to install the correct python libraries.

1 Like

Is it possible to add a “custom” section to the context menu. Where users, through settings, will be able to add commands that will use the current environment variables.
It seems to have the same effect as nautilus-open-any-terminal but more generalized

This already exists, and has existed for 20 years, though admittedly hard to discover and not really documented (contributions to solve this are welcome): the Scripts submenu.

You can search the web for “nautilus scripts” to learn more.

1 Like

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