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 ' jumps to tmux window 10 and up by number

Tmux
~/tips/tip-tmux-window-index-prompt

Ctrl-b '

Reaches windows numbered above 9 without cycling through them.

Ctrl-b plus a digit covers windows 0 to 9. Once a session grows past that, window 12 is suddenly a lot of Ctrl-b n away.

Ctrl-b '

The apostrophe opens a small prompt that asks for an index. Type 12, press Enter, and you are in window 12. It runs select-window with whatever you typed, so it accepts more than numbers:

logs
-1

A window name like logs works if it is unique enough, and the target syntax of tmux lets you use things like +1 and -1 for the next and previous window. Escape closes the prompt without doing anything.

I think it pays off most if you keep some windows at fixed numbers, say a scratch shell at 10 and a log window at 11, because then the keys become a habit.

If you renumber a lot, the visual pickers may suit you better: Ctrl-b w shows the tree of windows, and Ctrl-b f finds one by its content. Window numbers also shift when renumber-windows is on, so a fixed number only stays fixed if nothing before it closes.

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