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 kill-server ends every tmux session at once

Tmux
~/tips/tip-tmux-kill-server

tmux kill-server

Stops the tmux server and everything running inside it.

Sometimes tmux needs a clean start, for instance after an upgrade, when the running server is older than the new client. One command ends all of it.

tmux kill-server

This stops the tmux server. Every session, window and pane is closed, and the programs in them are ended. The next tmux command starts a fresh server that reads ~/.tmux.conf again from scratch.

There is no confirmation. A long download, an editor with unsaved work, a job you started in a detached session last week: all gone. I’d run tmux ls first to see what is still there.

If you use more than one server, it only kills the one you point at. With -L you choose the socket name:

tmux -L scratch kill-server

That leaves your normal server alone. To get rid of a single session there is tmux kill-session -t name, which is the safer habit.

When the server is already gone you get “no server running”, which is harmless.

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 Ctrl-b [ tmux new -s scratch \; set destroy-unattached on All Tmux tips (125) All topics

Link