15

Each time when I want to close terminal there is a popup with question "Close this terminal?" because some process is running in terminal. I don't care about this process. How to prevent terminal from showing this popup?

Wilf
  • 29,694
  • 16
  • 106
  • 164
scdmb
  • 1,147
  • 2
  • 11
  • 14
  • running the command in terminal with `nohup COMMAND & disown` can sometime fix it - this is useful if it is a GUI program like gedit or nautilus. – Wilf Jul 18 '14 at 21:44

3 Answers3

16

In 16.04 you'll find that choice in dconf-editor. You can install it, if necessary, with

sudo apt install dconf-editor

Then go to

org -> gnome -> terminal -> legacy

and uncheck confirm-close.

Hinz
  • 562
  • 7
  • 21
  • for begginers like me: after install it, run: `dconf-editor` in the terminal and you will see a gui and follow the next instructions. – Stav Alfi Sep 25 '21 at 15:10
  • You can also launch `dconf-editor` in the GUI. It has an icon and all. ;) – Hinz Oct 25 '21 at 09:56
3

You will have to install gconf-editor first. Just open the terminal using Ctrl+Alt+T and type the following command:

sudo apt-get install gconf-editor

After that, hit Alt+F2 or open the Dash and type gconf-editor and the configuration editor window will appear. Then you go to AppsGnome-terminalglobal and uncheck the option confirm_window_close.

Source

Fabby
  • 34,341
  • 38
  • 97
  • 191
zian
  • 31
  • 2
  • It seems like there is nothing under Apps called Gnome-Terminal. However, there is desktop `/`→ `desktop` → `applications` → `terminal` under which such option does not seem to exist, only `exec` and `exec_arg`. – Anders Lindén Dec 27 '16 at 21:57
  • 1
    This works for MATE terminal too, but you have to use `dconf-editor`, the key is under `org.mate.terminal.global` – Joril May 09 '17 at 08:37
  • This answer is out-of-date now. The correct answer for modern Ubuntu installations is [Hinz's answer](https://askubuntu.com/a/999781/560991) – Jonathan E. Landrum Feb 28 '18 at 16:04
0

Just press Ctrl + C to cancel any background process that may be running and then you can close the terminal without the popup showing up.


Note:

You can affect your system by closing the terminal with background processes running. A good example is if there is an update or upgrade running, the apt command can get locked up and you may start getting these errors:

E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

Luckily, they have been solved in this question.

That is just an example of what may happen if you close the terminal when a background process is running. Other things may happen depending on the process itself.

Parto
  • 15,027
  • 24
  • 86
  • 114