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 n and Ctrl-b p walk through your tmux windows

Tmux
~/tips/tip-tmux-next-previous-window

Ctrl-b n # next window

Moves to the next or the previous window in the session with a single key after the prefix.

With a handful of windows you do not need to look at the numbers. Step through them in order.

Ctrl-b n    # next window
Ctrl-b p    # previous window

The windows are ordered the way the status bar shows them, and both shortcuts wrap around at the ends. After the last window n brings you back to the first one.

This pairs well with Ctrl-b l, which jumps back to the window you were in a moment ago. Use n and p to browse, and l to bounce between two windows.

The commands behind the keys are next-window and previous-window, so you can bind them to other keys in your config if the defaults do not feel right.

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. Nothing else on your machine 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