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 Alt-n jumps to the next tmux window with activity

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

Ctrl-b Alt-n

Goes straight to the window that rang a bell or printed output.

When monitor-activity or a bell marks a window in the status bar, I want to go there, not count how many Ctrl-b n presses it takes.

Ctrl-b Alt-n
Ctrl-b Alt-p

These run next-window -a and previous-window -a. The -a flag skips every window without an alert and stops at the next one that has one: a bell, activity or silence, depending on the monitor options you turned on.

Visiting the window clears its alert, so pressing Ctrl-b Alt-n a few times walks you through everything that needs a look, and then it has nowhere to go.

A bell is the easiest alert to trigger yourself. Put this at the end of a long command and the window gets flagged when it is done:

make; printf '\a'

On macOS, Alt is the Option key, and many terminals send special characters for it unless you set Option to act as Meta. In iTerm2 and Terminal that is a profile setting. If the key does nothing, that is usually why.

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