tmux integration inconveniences
Thanks for filing an issue! Please answer the questions below so I can help you.
-
iTerm2 version: 3.1 beta 2
-
OS version: macOS 10.12
Detailed steps to reproduce the problem:
Set tmux integration to “open new windows as native tabs in a new window”, and enable “automatically bury client session”.
SSH into remote host, create a few tmux windows there, which will open in tabs. Switch to a different desktop space. Let SSH connection to remote host disconnect (due to, e.g., timeout, loss of network connectivity, etc).
Three things happen:
-
The buried window with the client session pops up on the current space, which is inconvenient because I’d most likely want to reconnect it from the original space to continue working there.
-
Inside that control window that popped up, iterm2 ends up sending tmux control commands to the shell:
Command Menu
——————————————
esc Detach cleanly.
X Force-quit tmux mode.
L Toggle logging.
C Run tmux command.
Detached
Connection to xxx closed.
# select-pane -t %1
-bash: select-pane: command not found
# select-window -t @1
-bash: select-window: command not found
# select-pane -t %4
# select-window -t @4
-bash: select-window: command not found
3 . When I reconnect to the tmux session, all the windows get recreated as tabs, as intended. However, iterm2 looses the state which tmux window was the active one when the SSH session went down. After the reconnect, it’s always the last tab re-opened that’s active now.
What should have happened:
-
It should reopen the client session on the same space where it originally was.
-
It shouldn’t send control commands to the shell.
-
It shouldn’t change which tmux window was active when the SSH session went down.
None of this is serious, it’s mostly inconveniences that would be nice to avoid. I really like the tmux integration, it’s working great otherwise!