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: tmux attach -d takes over a session from another screen

Tmux
~/tips/tip-tmux-attach-detach-others

tmux attach -d -t work

Attaches to a session and disconnects every other client that is still attached to it.

Moved from your laptop to the desktop and the session is still attached over there? Pull it over.

tmux attach -d -t work

-d detaches any other client attached to the session. Without it, two clients share the session and both see the same windows, and the smaller screen decides the usable size.

That shared sizing is the usual reason a tmux window looks cut off or filled with dots at the edges. Detaching the other client makes the session fit your current terminal again.

If you want to keep the other client attached but get rid of the dots, tmux detach-client -a run from your client does the same thing without a new attach.

Try it without risk: start a throwaway session with tmux new -s scratch, use the shortcut or command above there, look at what changes, and close it again with tmux kill-session -t scratch.

Further reading: tmux manual page (OpenBSD, official), tmux wiki: Getting Started (official)

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