brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Ctrl-b D lets you detach another client from a tmux session

Tmux
~/tips/tip-tmux-choose-client-detach

Ctrl-b D

Kicks a forgotten connection off your session from a list.

A session left attached on another computer keeps its size, so your window can end up framed by dots. You can detach that other client from where you sit.

Ctrl-b D

This opens choose-client, a list of every terminal attached to the server with its tty, session and size. Move to the one you want gone and press d to detach it. Enter on a client detaches it too, and q closes the list without doing anything.

A few more keys are useful in that list. x detaches the client and also sends a hangup to the process that started it, which usually closes that terminal or SSH connection. t tags several clients, and D detaches all tagged ones at once.

To see the same information from a shell, there is:

tmux list-clients

If I only want to take over a session when attaching, tmux attach -d is shorter. This list is for when you are already inside and want to choose.

Be careful with x on a client that is someone else’s login session, because their connection drops with it. A plain detach leaves their shell alive.

Further reading: tmux manual page (OpenBSD)

More Tmux tips tmux new -d -s report -x 200 -y 50 'top' tmux wait-for build-done set -g allow-passthrough on tmux kill-server Ctrl-b [ All Tmux tips (125) All topics

Link