1
So normally when you have an X terminal and you exit the window, the terminal dies and HUP is sent to all processes that have that terminal as controlling terminal, their usual response is to exit upon receiving HUP.
When tmux comes into it which sits in between the terminal and the actual process, typically a shell, this does not happen. Upon HUP tmux seems to just detach rather than kill any currently attached sessions. Which means the session keeps lingering around, but also the shell process itself and any running processes inside that shell.
So the ideal behaviour I'd want (but any improvement over the current is of course welcome) is.
- When the controlling terminal window in which a tmux instance is running exits and sends HUP
- tmux should send HUP itself to any of the sessions that are not currently attached elsewhere
- ideally only send it to sessions that have not explicitly been given a name
I know by the way you can avoid this with exiting with PREFIX+:kill-session
or simply ctrl+d
but the former is wordy and the latter only works with shells which exit upon EOF.