24

I realize the default of the Nemo's right-click "Open in Terminal" is to launch "gnome-terminal"; however, my installation is opening "xfce4-terminal" instead.

A while back when "gnome-terminal" was broken, I installed "xfce4-terminal" as an alternative.  I configured the system-wide defaults to call "xfce4-terminal" for the terminal.

After the issue with gnome-terminal was resolved, I moved the system-wide defaults back to gnome-terminal.  Nautilus starting using gnome-terminal again; however, Nemo continues to launch "xfce4-terminal".

I uninstalled "xfce4-terminal"; then the "Open in Terminal" feature of Nemo stopped working.

In attempts to resolve this issue I have done the following:

  • Reinstalled Ubuntu 16.04
  • Purged and reinstalled Nemo

Nemo still will launch only "xfce4-terminal".  It appears to be a problem in my home folder's Nemo configuration or some other per-user cache.  I created a new user, and Nemo properly launched "gnome-terminal".

Can someone help me with where to check and fix Nemo's functionality in my /home/username settings?

Is there some type of editable configuration to check what happens when clicking on the "Open in Terminal" function?

8 Answers 8

47

Google brought me here, so I'm reviving this thread in hope of saving at least one person from a few unnecessary headaches.

I'm using Debian and the suggestion from L. D. James here didn't work for me. So I took a look at Nemo's source code, and on line 132 of nemo-global-preferences.c I found that the (upstream) config schema is the following:

org.cinnamon.desktop.default-applications.terminal

I'm using Nemo as a substitute for Nautilus, and since I'm using Gnome3 instead of Cinnamon, for me this schema didn't even exist. So, I created it with the following command. After issuing this command, the 'Open in Terminal' action opens gnome-shell, in the correct directory:

gsettings set org.cinnamon.desktop.default-applications.terminal exec gnome-shell 

Just replace gnome-shell in the command with whatever terminal you'd like to use. Ex: for gnome-terminal, use:

gsettings set org.cinnamon.desktop.default-applications.terminal exec gnome-terminal

And for terminator (sudo apt install terminator) use:

gsettings set org.cinnamon.desktop.default-applications.terminal exec terminator
4
  • 1
    I don't understand how executing gnome-shell with bring up a preferring terminal emulator. I tested what would happen if the command gnome-shell was executed. It doesn't bring up a terminal. On the particular computer running the test it returned this error message: org.gnome.Shell already exists on bus and --replace not specified. It appears that you misunderstood the question. I run Ubuntu, 16.04 at the time... currently 18.04 functions properly with the same schema. By the way, default setting is x-terminal-emulator, which brings up gnome-terminal. Jan 21, 2019 at 23:53
  • 2
    With above, replace gnome-shell with whatever terminal application you want to use and it should work. Works on Arch...
    – Delorean
    Jul 2, 2019 at 22:15
  • you might want to try gsettings set org.cinnamon.desktop.default-applications.terminal exec terminator for 2023
    – rho
    Jan 12 at 6:02
  • Working on Fedora 37 under i3wm. Particularly for alacritty (you know, the best terminal)
    – onlycparra
    Oct 30 at 15:50
25

Nemo uses the gsettings configuration. This restored the intended behavior:

$ gsettings set org.gnome.desktop.default-applications.terminal exec gnome-terminal

On Ubuntu it's different for some reason:

$ gsettings set org.cinnamon.desktop.default-applications.terminal exec gnome-terminal
5
  • 3
    Actually, on Ubuntu, BOTH of those commands are required! The first one changes which terminal opens with Ctrl + Alt + T, and the 2nd command changes which terminal opens up with the right-click menu option in Nemo. Jun 21, 2020 at 2:44
  • 1
    Note: I've detailed installing Nemo in Ubuntu here: askubuntu.com/a/1173861/327339. I really think it should be the default file manager in Ubuntu, NOT Nautilus. Jun 21, 2020 at 2:45
  • Thanks. This also works on arch linux with xfce4: In my case: gsettings set org.cinnamon.desktop.default-applications.terminal exec terminator
    – Marcin
    Aug 11, 2021 at 10:31
  • For tilix: gsettings set org.cinnamon.desktop.default-applications.terminal exec tilix
    – LC117
    Jun 22 at 18:41
  • the Ubuntu variant works on Fedora 37 running i3wm. Although, for "obvious" reasons, I use the alacritty terminal
    – onlycparra
    Oct 30 at 15:48
8

On Xubuntu 18.10 this helps me (I use sakura as a terminal):

$ gsettings set org.cinnamon.desktop.default-applications.terminal exec sakura
6

In case you want not to replace, but to add "Open in Terminator" in your right-click menu,

  1. go to /home/$USER/.local/share/nemo/actions folder,
  2. create open_in_terminator.nemo_action file:
    [Nemo Action]
    
    Name=Open in Terminator
    Comment=Open the 'terminator' terminal in the selected folder
    Exec=terminator --working-directory=%F
    Icon-Name=terminator
    Selection=any
    Extensions=dir;
    EscapeSpaces=true
    

Close and re-open Nemo when done adding the file above.

Screenshot of the right-click menu now:

  enter image description here

Details

From Gabriel Staples, here:

Don't forget EscapeSpaces=true or else the "Open in Terminator" action won't work on any folder which has spaces, single quotes ('), or double quotes ("), within its path.

The old official documentation on that (which still applies to the version of nemo which can be installed on Ubuntu 22.04) says:

# Escape Spaces - set to true to escape spaces in filenames and uris ($U, $F, $P, $D)
#
# Sometimes this may be preferred to getting raw filenames that must be enclosed in
# quotes.
#
# Optional - by default this is false

EscapeSpaces=true

The new documentation says that this field is deprecated and in future version of Nemo does nothing:

# Escape Spaces (deprecated)
#
# This field is deprecated and does nothing - paths with spaces, as well as other special
# shell characters, will now be passed on correctly no matter what, even when Quote is not set.
#
# Optional - by default this is false

#EscapeSpaces=true

References:

  1. Blog post: "Add Right-Click Commands in Linux Mint / Ubuntu", by Angelos Kyritsis
  2. Sample Nemo right-click menu action file from /usr/share/nemo/actions/sample.nemo_action
  3. open_in_terminator.nemo_action file by Gabriel Staples in his eRCaGuy_dotfiles repo.
12
  • 1
    Done: I've edited your answer to match my own open_in_terminator.nemo_action file exactly. Now you can also right-click on a folder and choose to open the folder in terminator, as well as still right-click on the background in any folder to open up terminator there too. Jun 23, 2020 at 19:01
  • 1
    Click the "edited 17 mins ago" link and you'll see my edit in the history already. It must have been approved before you could approve it. The "credit" is only in the edit history, and in these comments here. I'll do one more minor edit to improve that <user> line still, so it will work on anyone's machine automtically using the environment variable $USER. Jun 23, 2020 at 19:14
  • 1
    FYI I've added this nemo action file to my GitHub repository here, in case anyone just wants to download it: github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/… Jul 11, 2020 at 17:39
  • 1
    FYI: When somebody with the authority to approve a suggested edit does “Improve Edit”, that automatically approves the pending edit.  It’s registered as a binding “Approve” vote by the Community♦ pseudo-user; see this. Aug 13, 2020 at 21:42
  • 1
    @G-ManSays'ReinstateMonica', I just checked and tested it: it works fine now in a directory named ~/temp/"test " (contains space and double quotes). Aug 13, 2020 at 22:00
2

First set the default X terminal:

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

Then you can set the default terminal for cinnamon to this x-terminal-emulator (Nemo is the Cinnamon file manager, so it takes its settings from Cinnamon config):

gsettings set org.cinnamon.desktop.default-applications.terminal exec x-terminal-emulator

Now your desktop environment (eg Gnome) and Cinnamon applications will all use the same terminal, and if you use the first command to change the X terminal in the future, your Cinnamon applications should also use that new terminal.

1
  • 1
    Unfortunately, in Ubuntu 18.04 at least, this doesn't work. The first command does but the 2nd one must be gsettings set org.cinnamon.desktop.default-applications.terminal exec terminator. Jun 21, 2020 at 2:40
2

Having wandered into this old thread, I can add my config, as of 2020. The settings for my system were almost identical:

org.cinnamon.desktop.applications.terminal

I do not have the default- part.

1
  • Yes. for me too. /org/cinnamon/desktop/applications/terminal/exec
    – vrgovinda
    Apr 4 at 9:04
2

Find and Open "Preferred Application" in the main menu.

Menu to find Preferred Application

Choose "Terminator" in the "Preferred Application" dialog.

Preferred Application

This will set terminator as the default terminal app for the system.

  1. You can use "CTRL + ALT + T" to open terminal.
  2. RClick and open context menu in Nemo File Manager in any directory and open the terminal from there.
  3. If there is an "arguments" field, change it from "--" to "-x" when using Terminator or you will not be able to execute scripts from Nemo by double clicking.

These will all open Terminator or the default terminal that you've set.

1
0

Nemo determines your default terminal by querying gsettings.

To locate all schemas related to "terminal", I did this:

gsettings list-schemas | grep terminal

For me, that listed these schemas:

org.cinnamon.desktop.default-applications.terminal
org.mate.applications-terminal
org.gnome.desktop.default-applications.terminal

Since Nemo is the default file manager of the cinnamon desktop, the first schema (above) is the one we're interested in.

You can determine the current settings of a schema using gsettings list-recursively schemaPathGoesHere. For example:

gsettings list-recursively org.cinnamon.desktop.default-applications.terminal

In my case, this revealed that Nemo is currently using the x-terminal-emulator:

org.cinnamon.desktop.default-applications.terminal exec 'x-terminal-emulator'

To set this to Gnome Terminal (instead), use gsettings set schemaGoesHere exec 'terminalLaunchCommandGoesHere'. Like this:

gsettings set org.cinnamon.desktop.default-applications.terminal exec 'gnome-terminal'

You must log in to answer this question.

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