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 terminal.app sends, and compare them with the signals sent on other OS's.

  • 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: <stackoverflow.com/q/7863429/754997> – Chris Page Oct 24 '11 at 19:32

You must log in to answer this question.

Browse other questions tagged .