Kick out a stale client
You are the only client on home, and no client is left on learn.
A client is one terminal attached to the server. Three ways to get rid of one:
C-b D- client mode, a list of every client on the server; Enter or
ddetaches the selected one attach -d -t nameatC-b :- attach yourself and detach every other client on that session
detach-client -aatC-b :- detach everyone except you
Run these at C-b :, not in a pane’s shell. A pane already has $TMUX set, so tmux attach there refuses to nest.
A session can have several clients, and it is drawn at the size of the smallest one — which is why a stray client makes a session mysteriously cramped.
Press C-b D, move to one of the clients on home, press Enter.
Three clients were listed: yours on learn, two on home. The one you picked goes, and its window in learn closes with it.
Press q if the list is still open, then C-b :, type attach -d -t home, Enter.
The screen switches to home, and you are its only client.
Detaching is not moving a client
Even if you forced the nested attach through, it would only add a second client rather than move the one you are sitting at. Detaching a client changes nothing inside the session itself.
Here is what just happened.
C-b D runs choose-client; detaching from it is what C-b d does to your own client. attach at the prompt is attach-session, which reattaches the client that ran it: -d detached the remaining stray, and your own client moved off learn, leaving it with none.
- Client mode: Enter or d detaches the selected client, D the tagged ones; q exitsC-bthenD
- Move this client to that session and detach every other client from it:attach -d -t name
- Detach all clients except the one running the command:detach-client -a
Go further
detach-client -afrom inside a session detaches everyone but you.new -A -D -s namecombines attach-or-create with detach-others.- In client mode,
xandXalso try to kill the shell the client was started from.
- 1Do not go looking for a shell to type
tmux attachinto: inside a pane it refuses to nest. RunattachatC-b :. - 2
C-b Dlists every client on the server. Move to one onhomeand press Enter to detach it. - 3
C-b :thenattach -d -t homemoves your own client tohomeand detaches everyone else on it, which leaveslearnwith none.
This is a live terminal. Typing goes to the machine, including Tab. Press Shift and Tab together to move focus back out to the page.
A real terminal, in this tab
Alpine Linux and tmux 3.4 on an x86 emulator. Nothing to install, and no server behind it.
about 15 MB, once
Done when
not started- Only one client remains attached to session home— not done yet
- The learner's client has left session learn— not done yet
- The one remaining client is on home— not done yet