Skip to content

Is it possible to prevent tmux session to close when I close a tab

Thanks for filing an issue! Please answer the questions below so I can help you.

  • iTerm2 version: Build 3.4.20210507-nightly
  • OS version:
  • Attach com.googlecode.iterm2.plist here (drag-drop from finder into this window)

tmux setup:

image

What happened:

The following iTerm2 actions affect tmux: Close a session, tab, or window: Kills the tmux session or window.

tmux integration , tmux session closed when I close the tab

Basically, I connect to a remote node using ssh and close the terminal window.

$ ssh -xt4C ip@<port>
# => close the terminal windows
Now I see following message:

Command Menu
----------------------------
esc    Detach cleanly.
  X    Force-quit tmux mode.
  L    Toggle logging.
  C    Run tmux command.
Detached
~$ exit [ ENTER ]  
 $ ssh connect  # new tmux session is started, where I want previos tmux session to continue if possible

What should have happened:

Is it possible to prevent this? Like when I close the tab or terminal, I want ssh session to continue, if possible.

Edited by Alper Alimoglu