Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using tmux, if I CMD-W, or otherwise quite out of terminal, my tmux session persists, as it should. However, it still lists itself as "attached", whereas on other platforms, (e.g. Ubuntu) when the terminal exits it must signal tmux in some way that it has detached. (Also works when logged in through ssh and I kill ssh; tmux notices that the terminal connection has detached)

Is there some way to debug this? I'd like to see what signals sends, and compare them with the signals sent on other OS's.

share|improve this question
The application running inside the terminal, i.e. here tmux, should receive SIGHUP when the terminal goes away. – Gilles Oct 23 '11 at 0:49
I found this stackoverflow question which answers my question using bash. It works, except that I don't get a SIGHUP when the terminal closes. I in fact, receive only a SIGEXIT, which is surprising. When I find out more, I will update this answer. – staticfloat Oct 23 '11 at 1:16
That script shows SIGHUP and SIGEXIT for me. What shell are you using? I don't know of a way to prevent Bash, the default shell, from receiving SIGHUP when the terminal is closed, unless it's somehow configured to ignore SIGHUP without using trap (or if something uses trap after you've run that script). Terminal closes the pty, and /usr/bin/login should send SIGHUP to the shell; then Terminal sends SIGHUP to the shell, waits a few seconds, then sends SIGKILL. I suppose if there was some kind of delay for a few seconds, it could kill Bash before it received the SIGHUP. But that's unlikely. – Chris Page Oct 24 '11 at 19:27
For reference, @staticfloat asked essentially the same question on StackOverflow: <>; – Chris Page Oct 24 '11 at 19:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.