When you open gnome-terminal
without any options and execute a blocking command (e.g. python3
, vim
or cat
) and then try to close the window by the close button (i.e. x
button in the title bar) or some keyboard shortcut, a confirmation window is displayed:
However, when you open gnome-terminal
with an executed command specified, that is, in the form of gnome-terminal -- python3
, the confirmation window is no longer displayed and the window is closed right after you (accidentally) click the close button.
Is it possible to show the confirmation window even when you use the form gnome-terminal -- <command>
? If that's impossible, is there any workarounds?
Environments:
$ gnome-terminal --version
# GNOME Terminal 3.36.2 using VTE 0.60.3 +BIDI +GNUTLS +ICU +SYSTEMD
What I've Tried:
Equipping the executed command with signal handlers for all the supported signals didn't work; the window was still closed without confirmation although the process survived the closure while catching
SIGHUP
(three times),SIGCONT
(once) andSIGWINCH
(once). I had additionally to executekill -SIGKILL <process id>
to kill the process.I found one exception. When you execute
gnome-terminal -- bash
, the confirmation is displayed (though this is by default the same asgnome-terminal
).