135

How can I set the default terminal used in Unity?

I would like to use the Ctrl+Alt+T hotkey to start a non-default terminal. The default terminal is gnome-terminal.

Where can I change the default terminal value?

0

12 Answers 12

130

For 12.04 and newer

gconf is now deprecated - http://en.wikipedia.org/wiki/GConf - and gsettings can be used in its place.

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

Where terminal is the command you would use to open it from the terminal.

14
  • I have installed terminator as terminal and uninstalled gnome-terminal but the command you suggested does not work for me. Apr 9, 2014 at 9:59
  • Works fine for me on 13.10.
    – Martin
    Apr 10, 2014 at 11:29
  • 2
    I use Terminator as my main terminal, but after running this command, ctrl+alt+T does not work anymore at all. Sep 21, 2014 at 16:09
  • 2
    @TorbenGundtofte-Bruun replace konsole with gnome-terminal
    – Rumesh
    Apr 25, 2015 at 11:39
  • 1
    Still works for Ubuntu 16.04
    – geekQ
    Jun 11, 2016 at 12:02
73
sudo update-alternatives --config x-terminal-emulator
4
  • 6
    While this is a great answer to the question (and generally a preferrable way to change a default program IMHO) this may not be the 'weapon of choice' in all circumstances. To elaborate: I wanted to set guake terminal as default but it never showed when trying to do so by update-alternatives.
    – FuzzyQ
    Aug 4, 2012 at 17:13
  • 1
    Also, You can edit directly to the script xdg-open :) sudo gedit `which xdg-open`
    – iegik
    Aug 6, 2012 at 9:40
  • 1
    This does not change the shortcut command result, as clearly stated in the question, I don't get why it has so many upvotes.
    – m3rosss
    Jul 30, 2017 at 11:00
  • It works for me on Ubuntu 17.04. I installed terminology and it became the Ctrl+Alt+T terminal. Ran update-alternatives and changed it back to gnome-terminal, and it worked immediately.
    – rjh
    Dec 19, 2017 at 15:21
40

Only in Ubuntu 11.10 or earlier! For newer versions see LucaB answer!

Open a terminal (e.g. gnome-terminal)

Run the next command:

gconftool --type string --set /desktop/gnome/applications/terminal/exec <YOUR-TERMINAL>

e.g.:

gconftool --type string --set /desktop/gnome/applications/terminal/exec terminator

Done :).

3
  • 5
    This doesn't fix it for me. When I start Htop via its .desktop file (which specifies Terminal=True), it starts in Gnome Terminal no matter what. Is there yet another place to change the default terminal emulator? May 4, 2012 at 1:05
  • 2
    THE CORRECT ANSWER IS BELLOW!
    – user23907
    Sep 10, 2013 at 13:22
  • @gerep My answer is correct, because the question defined exactly the Ubuntu version: 11.10. Of course in the newer versions the gconftool is deprecated, so not this the right solution.
    – Regisz
    Sep 12, 2013 at 9:28
28

To change the shortcut and not default termainal,

  1. search for keyboard
  2. go to shortcuts and custom shortcuts
  3. press the plus sign to add new shortcut (in this case terminator)
  4. when told that the shortcut ctrl+alt+t is already in use press "reasign"

search for keyboard add new shortcut reasign

3
  • 2
    does not work for me. Mar 23, 2014 at 18:26
  • +100 for being the easiest to understand and the one that has withstood the test of time. Dec 23, 2016 at 18:03
  • Since sudo update-alternatives --config x-terminal-emulator came back with "There is only one alternative in link group x-terminal-emulator (providing /usr/bin/x-terminal-emulator): /usr/bin/gnome-terminal.wrapper Nothing to configure." and this even though I have Guake installed, I used this option. Changed the normal terminal to Shift+Ctrl+Alt+T and setup Guake to use Ctrl+Alt+T in its place. The only issue is that I'd like to right click and Open in Terminal too. Plus, Guake is set to F12 and what I prefer to use over Ctrl+Alt+T either way. It's a nice addition, nonetheless.
    – Natetronn
    Mar 28, 2019 at 23:21
7

Try to change option x-terminal-emulator via "ALternatives Configurator" app.

for ubuntu you can use the command below:

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

It will list all the terminal options you have installed and then you can pick (by the number) the one you want.

1
  • 2
    a little bit helping: 'Alternatives Configurator' is 'galternatives'
    – Regisz
    Oct 26, 2011 at 14:20
5

To configure the default terminal in gnome you need to install dconf-tools (sudo apt-get install dconf-tools).

After that you can use the gsettings to set your favorite terminal emulator.

Lets say your favourite terminal emulator is termite.

Install it with sudo apt-get install termite

After that type this command

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

Since termite does not take any arguments (or it does, depends on what you do with it, you can set them this way) use this to set empty or set the exec-args for the terminal you need

gsettings set org.gnome.desktop.default-applications.terminal exec-arg ""

After this termite will be your default terminal emulator.

3
  • there is another way outlined in askubuntu.com/questions/70540/… Nov 16, 2011 at 21:15
  • Its the same thing, really does not mater, this way uses the replacement tool for gconf Nov 16, 2011 at 21:22
  • exec-arg didn't work for me unfortunately. I was trying to start terminal in fullscreen mode. The only option that helped was specifying the option in configuration. I am using terminator
    – Timofey
    Oct 29, 2012 at 20:57
4

Try

sudo update-alternatives --config x-terminal-emulator
1
  • 1
    Hmm, on second thought, this doesn't seem to be updating it. Oct 26, 2011 at 19:21
2

The update-alternatives system is a Debian thing, but Gnome run on many more distributions, so it has its own way to define preferred applications.

You can set default terminal through the utility gnome-default-applications-properties, also accessible through gnome-control-center as Preferred Applications.

Alternatively you can set the gconf registry key /desktop/gnome/applications/terminal/exec.

However, it is not guaranteed that all applications provided by Gnome, like nautilus, will respect this setting, or rather use their own settings.

2

This worked in Ubuntu 13.10

gsettings set org.gnome.desktop.default-applications.terminal exec terminator
1
  • This is what worked for me on Ubuntu 14.04 with terminator Sep 3, 2016 at 2:23
1

If you go to the Keyboard shortcuts, you will notice under the Launcher section that Ctrl+Alt+T is tied to the "Launch Terminal" action. I haven't tested it yet, but you can create a Custom Shortcut to your preferred Terminal, and bind that shortcut to it instead.

0

OK, one weird thing is that the compiled gnome-terminal with the patch will not work if your DISPLAY var is :0 , works flawlessly if DISPLAY=localhost:0.

So you can edit /usr/bin/gnome-terminal/wrapper and add this:

ENV{"DISPLAY"}="localhost:0";

right before the exec line.

Subsequently you can use /usr/bin/gnome-terminal/wrapper as the launcher!

0
sudo update-alternatives --set x-terminal-emulator <terminal-path>

For example:

sudo update-alternatives --set x-terminal-emulator /usr/bin/tilix

If you want to do it with interactive mode or check paths:

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

You must log in to answer this question.

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