mklement0 / ttab

macOS and Linux CLI for opening a new terminal tab/window, optionally with a command to execute and/or display settings
285 stars 15 forks source link

In Gnome Terminal, pressing Ctrl-C while a startup command is running doesn't keep the session open. #43

Closed mklement0 closed 2 years ago

mklement0 commented 2 years ago

As reported by @barankyle here:

The design intent of ttab is to run commands specified on the command line in an instance of the user's default shell.

This means that you should be able to abort such startup commands by pressing Ctrl-C, without terminating the shell session as a whole.

While this works as intended on macOS, with Gnome Terminal on Linux the shell session is currently terminated, thereby (typically) closing the new tab.

Note that an unavoidable limitation of using ttab with Gnome Terminal is that keeping the session open can only be emulated: that is, for technical reasons a new instance of the user's default shell must be created that replaces the instance that ran the startup command - as such, the original shell's environment isn't fully preserved.