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 m marks a tmux pane so you can swap or join it later

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

Ctrl-b m

Marks one pane as the source for swap-pane and join-pane.

Pane commands like swap-pane and join-pane want a source and a target. Typing pane numbers from another window is fiddly, so tmux lets you mark the source instead.

Ctrl-b m

That marks the current pane, and its border gets a highlight. Now go to any other window, pick the pane where you want it, and run one of these from Ctrl-b ::

swap-pane
join-pane

Without a -s argument, both commands use the marked pane as the source. swap-pane trades places with it, join-pane pulls it into the current window as a new split. I like this a lot more than working out whether it was 2.1 or 3.1.

Ctrl-b M clears the mark, and pressing Ctrl-b m on the marked pane again toggles it off. Only one pane on the whole server can be marked at a time, so marking a new one silently moves the mark.

If you want to see it in your status bar, the format #{pane_marked} is 1 for the marked pane, which works nicely with a conditional like #{?pane_marked,M,}.

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