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: tmux list-keys | grep finds the binding you forgot

Tmux
~/tips/tip-tmux-list-keys

tmux list-keys -T prefix | grep split-window

Searches all tmux key bindings from the shell, including the ones you added yourself.

Ctrl-b ? is a long list. Grep makes it short.

tmux list-keys -T prefix | grep split-window

The output shows every key in the prefix table with its command, such as bind-key -T prefix % split-window -h. After you add your own bind lines, they show up here too.

The command prints the same data as Ctrl-b ?, but as text you can filter. That matters once you have your own bindings and cannot remember whether you put the reload on r or on R. Grep for the command name or for the key and you have the answer.

A few useful patterns: tmux list-keys -T prefix | grep -i copy for everything with copy in it, and tmux list-keys -T copy-mode for the keys that work inside copy mode, which are a separate table in emacs mode, and copy-mode-vi after you switch to vi keys. Add -N to include the short descriptions where tmux has them.

Without -T prefix you also get the root, copy-mode and other tables, which is a lot more text.

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), On this site: set -g status-position top moves the tmux status bar to the top, On this site: bind r to reload your tmux config without restarting anything

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