1

in the Ubuntu default file manager when right-clicking there is an option to Open in Terminal.

How can I change the terminal-emulator for the "Open in Terminal" option? I have changed my terminal emulator with the following command:

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

But it did not change for the "Open in Terminal" option.

atix
  • 11

2 Answers2

2

The option to open a terminal by right-clicking a file in nautilus is provided by a nautilus extension. That extension, unfortunately, is hard coded to work with gnome-terminal.

You can install an extension, nautilus-open-any-terminal, that allows to select a terminal of choice to be used for the "Open terminal here" option. As a very valuable added bonus, it also allows you to set a shortcut key to open a terminal in the current directory. Yes, you may feel that I use the extension myself, even if it is for gnome-terminal.

Removing the default extension

Remove the default extension with the command:

sudo apt remove nautilus-extension-gnome-terminal

This is the name as of Ubuntu 21.10. In older versions, the package was named nautilus-open-terminal.

Installing the python extension gnome-open-terminal

Install the dependency:

sudo apt install python-nautilus

Then install the extension

pip3 install --user nautilus-open-any-terminal

Then run the following command to allow configuring the extension using dconf:

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

Configuring

Set your preferred terminal using a command like the following (example for alacritty, see on the extension's website for the list of supported terminals):

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal terminal alacritty

To set the shortcut key for opening the terminal:

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal keybindings '<Ctrl><Alt>t'

If your terminal supports tabs, and you want the new terminal opened as a new tab instead of as a new window:

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal new-tab true
vanadium
  • 88,010
  • can you add mutilple terminal entries in context menu using this above method. like for backup situation dafault terminal . because i added the terminator terminal and it replaced the default terminal. can they both live side by side. – tikendraw Dec 04 '23 at 03:52
  • @tikendraw Ik you keep the default extension, the entry for the default terminal emulator also will be there. – vanadium Dec 04 '23 at 07:08
  • hey, I don't have ~/.local/share/glib-2.0/schemas/ in my newly installed ubuntu. getting this. error glib-compile-schemas ~/.local/share/glib-2.0/schemas/ Error opening directory “/home/t/.local/share/glib-2.0/schemas/”: No such file or directory Help me. – tikendraw Dec 19 '23 at 03:09
0

You should change your file browser configuration to point at new terminal emulator.

For Ubuntu default Nautilus you could see several options here.

Alexander
  • 1
  • 1