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 x closes the tmux pane you are in, after a confirmation

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

Ctrl-b x

Closes only the current pane, asking first, and leaves the rest of the window alone.

Typing exit works, but not when the program in the pane is stuck. This closes the pane from the outside.

Ctrl-b x

tmux asks kill-pane X? (y/n). Press y and the pane is gone and the neighbouring panes grow to fill the space. Any other key cancels.

The program in the pane gets a hangup signal. Programs that ignore it can survive, so check with ps if something still needs to be stopped.

The command line version is tmux kill-pane -t 2. Add -a to close every pane in the window except the one you name, which is handy for cleaning up a layout that got out of hand.

Try it safely: start a throwaway session with tmux new -s scratch, run it there, and close the session again with tmux kill-session -t scratch. Nothing else is touched.

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