Add ‘Open Terminal Here’ for other Terminal Emulator in Ubuntu 22.04

Want to let “Open in Terminal” context (right-click) menu option work for another terminal emulator? Here’s an extension to do the similar job for Nautilus.

When right-clicking on either a folder or blank area in file manager, there’s an “Open in Terminal” menu option to launch system default terminal with that folder as working directory.

The option in Ubuntu so far is provided by the built-in gnome-terminal package. Meaning no way to use the option for another terminal emulator. However, there’s an extension can add similar option to open terminal from in-side folder.

And not only for Gnome Terminal, the extension supports many other terminal emulators:

  • alacritty
  • blackbox
  • cool-retro-term
  • deepin-terminal
  • foot/footclient
  • guake
  • hyper
  • kermit
  • kgx (GNOME Console)
  • kitty
  • konsole
  • mate-terminal
  • mlterm
  • qterminal
  • sakura
  • st properly patched
  • tabby
  • terminator
  • terminology
  • termite
  • tilix (the package itself supports this stuff)
  • urxvt
  • urxvtc
  • wezterm
  • xfce4-terminal

The extension adds the menu option “Open XXX Here“, with XXX changes automatically according which terminal emulator is in use.

Advertisements

How to Install the Nautilus Extension

This tutorial is tested and works in Ubuntu 22.04, Ubuntu 23.04, and Ubuntu 20.04. It should also work in Fedora Workstation and other Linux with GNOME & Nautilus.

1. First, press Ctrl+Alt+T on keyboard to open terminal. Then run command to install git and python3-nautilus package:

sudo apt install git python3-nautilus

2. Then, clone the source code from Github project page, by running command:

git clone https://github.com/Stunkymonkey/nautilus-open-any-terminal.git

3. Finally, run the installer in the source code to install the extension:

cd nautilus-open-any-terminal && ./tools/update-extension-user.sh install

It installs the extension for current user only. If you would like to make it work for all users in system, run sudo ./tools/update-extension-system.sh install instead.

Apply and Set your Terminal Emulator

After installed the extension, apply it by running command to quit Nautilus:

nautilus -q

Then, open “Dconf Editor” (install it from Ubuntu Software) and navigate to ‘com/github/stunkymonkey/nautilus-open-any-terminal‘. Finally, set the value of ‘terminal’ to tell which terminal emulator to use.

You can of course choose another terminal emulator by running command (replace kgx with yours):

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal terminal "kgx"

Tip: You may also remove the built-in ‘Open in Terminal’ option by running command:

sudo apt remove nautilus-extension-gnome-terminal

Uninstall

There seems no uninstaller script at the moment of writing. User can however manually removed the installed files by running command:

rm ~/.local/share/nautilus-python/extensions/open_any_terminal_extension.py
rm ~/.local/share/glib-2.0/schemas/com.github.stunkymonkey.nautilus-open-any-terminal.gschema.xml
rm ~/.local/share/locale/*/*/nautilus-open-any-terminal.mo

If you installed the extension system wide for all users, use the commands below instead to remove all the files:

sudo rm /usr/share/nautilus-python/extensions/open_any_terminal_extension.py
sudo rm /usr/share/glib-2.0/schemas/com.github.stunkymonkey.nautilus-open-any-terminal.gschema.xml
sudo rm /usr/share/locale/./*/*/nautilus-open-any-terminal.mo

Also quit file manager via nautilus -q command to apply change.