The classic story goes:
I have a terminal emulator with multiple tabs/screens. In each tab, I start an SSH session to a remote server. I start possibly long-running interactive jobs in those sessions. A connection to the remote server is broken, the tab affected now shows the local shell, I reconnect to the server by starting a new SSH session to find the interactive job on the server dead.
Now, the canonical answer to this is: use screen or tmux. Apart from just "saving" your session, there are also features such as multiple tabs, etc.
But why would I want multiple tabs if this is already in a multiple-tab environment of my local terminal emulator app?
The question is: Can I have persistent remote SSH sessions inside the tabs/screens of my terminal emulator WITHOUT having to manually start (or attach to existing) screen or similar? Can there be a wrapper to the SSH session that runs in each of my tabs, such that it manages the persistence of the session? (much like screen does for local shell)
So ideally: I create a new tab in my terminal emulator, start an remote ssh session, do long-running work, get disconnected, reconnect and the tab automagically reattaches and I see my work continuing. So like byobu but the tabs are native tabs of my terminal emulator.
tmuxautomatically. – AlexD Feb 14 '24 at 11:51