16

Gnome-Terminal is terrible.

It's buggy and whenever Gnome-Shell restarts or resumes from suspend, all Gnome-Terminal windows become unusable and can't be closed. There's an old ticket opened for it, but it'll likely never be fixed.

In the meantime, I've been trying to use other terminal packages. Unfortunately, Gnome-Shell still thinks Gnome-Terminal is what it should use whenever I select "open in terminal" in various menus. If I uninstall Gnome-Terminal, these menus disappear. What's the easiest way to keep the menus, but make my preferred terminal window open instead?

Cerin
  • 6,485

6 Answers6

18

Or you may simply use: sudo update-alternatives --config x-terminal-emulator

as per comment; to update it on per user basis check https://serverfault.com/questions/631447/how-to-use-update-alternatives-per-user

Galvani
  • 470
  • This worked perfectly for me, should be the correct answer IMO (the Default Applications GUI still doesn't have a terminal option for some reason). – GTF Jun 12 '20 at 11:06
  • 1
    Downvote for a simple reason: 1. this has side-effects on all users (which should at least be mentioned in an answer for a multi-user system) and 2. suppose you use an application that is only installed for you (think Alacritty), you'd be installing a global alternative for a local application and 3. this only works for packaged terminal emulators. So while this answer is formally correct, it is missing important information for the sort of readers who are inclined to merely copy & paste commands from the web and may unwittingly run into those unmentioned side-effects. – 0xC0000022L Nov 12 '20 at 07:47
  • Also, in the Gnome dash, x-terminal-emulators are not grouped together. Using gsettings is better. – Maxime Oct 13 '21 at 12:33
  • This is one of the best answers, it shouldn't receive a downvote just because it doesn't contain info X or Y. That why this section below exist, to add extra comments and then the owner of the answer can update it later or the person looking for an answer can also see it is not updated yet. Also what is the amount of people who share a PC with linux (desktop) with more users.... this argument is just annoying bs – Bruno de Oliveira Oct 29 '22 at 17:53
  • This is the only solution that should be accepted!!! – Antonio Petricca Mar 22 '23 at 11:32
6

On Ubuntu / LinuxMint to set the terminal emulator app for Nemo's

  • file explorer right-click
  • Ctrl+Alt+T Shortcut

executing the following allowed me to set terminator as default

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

Depending on your distro's Desktop/xserver setup and which file explorer you use, you might have to replace org.cinnamon.desktop with org.gnome.desktop or maybe even org.kde.desktop.

Suggestions can be found by calling gsettings:

gsettings  list-schemas | egrep -i "desktop"

For LinuxMint19&Nemo, the cinnamon-variant worked straight away, without even logging out.

(came from https://unix.stackexchange.com/questions/336368/how-to-configure-nemos-right-click-open-in-terminal-to-launch-gnome-terminal)

hirsch
  • 181
2

Ideally, there'd be an option under Details->Default Applications, but there's currently no option for "terminal".

My workaround was to install Terminator, or any other of the many GUI terminal packages which does suffer the gnome-terminal bug, and then symlink it to /usr/bin/gnome-terminal, e.g.

sudo mv /usr/bin/gnome-terminal /usr/bin/gnome-terminal.bak
sudo ln -s /usr/bin/terminator /usr/bin/gnome-terminal

The two binaries don't have identical parameters, but so far they seem to be similar enough that all my terminal launchers (nautilus-open-terminal, Eclipse, etc) all seem to pick it up seamlessly.

Cerin
  • 6,485
  • 1
    Agreed. It should be at Details->Default Applications. I hope someone has time to file that as a feature request (I don't right now). – Lonnie Best Apr 19 '18 at 01:24
  • This is the solution for newer Gnome-Versions. See https://askubuntu.com/questions/111592/how-do-i-set-the-default-gnome-terminal or https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1559#note_592512 – Asturio Jun 28 '21 at 21:01
2

I wouldn't recommend symlinking another terminal app to gnome-terminal. If any other application in the system is trying to invoke gnome-terminal with specific parameters this might fail. On top of that symlinking might cause issues with package/system upgrade.

Simply keep your favorite terminal app (terminator/tilda/guake etc) in ubuntu dock/start menu. The other option is to configure nautilus file manager to open your favorite terminal. I presume this is the most likely use case for most people anyway.

sudo apt-get install nautilus-open-terminal nautilus-actions

enter image description here Nautilus actions config tool

Sandeep
  • 590
  • 4
  • 5
0

I was able to solve this by modifying the GNOME Application in /usr/share/applications/.

  1. Find and open the terminal application. For myself it was located at /usr/share/applications/org.gnome.Terminal.desktop
  2. Modify uses of "TryExec" and "Exec" to replace gnome-terminal with your terminal emulator of choice.
  • For this step, if you want interoperability with update-alternatives, you can replace gnome-terminal with x-terminal-emulator. That way, when you use update-alternatives to change the destination of x-terminal-emulator, the application will update automatically.
  1. Restart the terminal

So far this solution has worked quite well for me. It has the caveat that the application will show up as your terminal of choice, rather than GNOME Terminal, on the dock - you will have to observe what I mean for yourself.

In my case, I use alacritty. To enable CTRL+N functionality I had to configure alacritty similarly to here.

A248
  • 101
-1

You can also use nautilus-python extensions. Just install nautilus-python and save this script as ~/.local/share/nautilus-python/extensions/OpenInTerminal.py.

import os

from gi.repository import Nautilus, GObject

class ColumnExtension(GObject.GObject, Nautilus.MenuProvider):
    def __init__(self):
        pass
    def menu_activate_cb(self, menu, file):
        # Command to run terminal
        os.system("terminator --working-directory=" + file.get_location().get_path())

    def create_menu_item(self):
        return Nautilus.MenuItem(name='TerminatorExtension::Open_Terminator',
                                     label='Open terminal here',
                                     tip='Open terminal in current directory',
                                     icon='')

    def get_background_items(self, window, file):
        item = self.create_menu_item()
        item.connect('activate', self.menu_activate_cb, file)
        return item,

    def get_file_items(self, menu, files):
        if len(files) != 1:
            return
        file = files[0]
        if not file.is_directory():
            return
        item = self.create_menu_item()
        item.connect('activate', self.menu_activate_cb, file)
        return item,
Melebius
  • 11,431
  • 9
  • 52
  • 78