1

I use tmux regularly to easily handle multiple terminals on my local machine. Sometimes, I need to connect to a remote machine and start a script in one the terminals (i.e. a pane or window in tmux). If my machine disconnects for any reason during this process, the remote script is killed and I cannot re-attach to the remote terminal that started the process.

Part of the purpose of terminal multiplexers is to deal with this precise scenario, but in my case, since I am running tmux on the local machine, I can't re-attach to the terminal that started the remote process.

One option would be to run tmux (or GNU screen) on the remote machine within one of the panes of my local tmux session, but I am concerned about running into keyboard shortcut conflicts when nesting either screen or tmux within tmux.

What is a good way of handling this problem? Is nesting console multiplexers a good idea? Is it the only solution to this problem?

  • Nesting works fine with tmux: you just assign a separate prefix key. – jasonwryan Apr 11 '14 at 0:39
3

One approach is to use a terminal multiplexer only on remote machines. Running each shell in a separate terminal emulator has the advantage that you can put multiple shell windows side by side. On a remote machine, resistance to disconnection is a big win that justifies terminal multiplexers, but locally, they have fewer advantages.

If you do want to nest terminal multiplexers, using different prefix keys locally and remotely would be the easy way to cope.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.