Ssh – How to replicate (fork) the current terminal

productivitysshterminal

Say I am using terminal and have sshed to a remote machine and did something.
How do I create a new terminal tab (or window) so I still has everything from the previous terminal window without having to do the whole thing like ssh, cd, etc. – just like forking. Then I can start working in the new window separately from the previous one.

Best Answer

Not exactly what you ask, because you don't have a new real window or tab.

You can start screen on the server (if available), so that you can multiplex your server sessions.

After that you have still a single screen window, but if you do Ctrl+a c, you create a new screen window, and switch between the windows with Ctrl+a 0, Ctrl+a 1.

You have the added advantage that you can disconnect from the server leaving the two (or more) sessions alive (Ctrl+a d), then restore them later (screen -dr).

Related Question