To use tmux for a persistent Midnight Commander session that survives SSH disconnections:
-
SSH into your server and start tmux:
ssh your-server tmux new -s mc
-
Launch Midnight Commander inside tmux:
mc
Now your Midnight Commander session runs inside tmux and won't be interrupted if your SSH connection drops[1][3].
When your SSH connection interrupts, simply reconnect and reattach to your tmux session:
ssh your-server
tmux attach -t mcYour Midnight Commander will be exactly as you left it[1][5].
- Detach manually (leave tmux running): Press
Ctrl+bthend - List active sessions:
tmux list-sessions - Kill session when done:
tmux kill-session -t mc
The key advantage is that tmux keeps your session alive on the server even when you disconnect, so long-running tasks or file operations in Midnight Commander won't be interrupted[3][5].