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: set -g prefix C-a moves the tmux prefix to a closer key

Tmux
~/tips/tip-tmux-change-prefix

set -g prefix C-a

Changes the tmux prefix key from Ctrl-b to Ctrl-a, which is easier to reach.

Ctrl-b is a stretch for one hand. Many people move the prefix to Ctrl-a.

unbind C-b
set -g prefix C-a
bind C-a send-prefix

The first line frees the old prefix, the second sets the new one, and the third lets you send a literal Ctrl-a to a program inside tmux by pressing it twice.

Ctrl-a is also the shell shortcut for the start of the line. With this change you press Ctrl-a Ctrl-a to reach it inside tmux, which gets old. Pick another key such as C-Space if you rely on that shortcut.

Existing sessions pick up the new prefix when you reload the config. Remember that every guide and cheat sheet that says Ctrl-b now means your new key.

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.

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