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: bind r to reload your tmux config without restarting anything

Tmux
~/tips/tip-tmux-reload-config

bind r source-file ~/.tmux.conf \; display-message "Reloaded"

Adds a key that re-reads ~/.tmux.conf inside a running tmux session.

Editing the config and then wondering why nothing changed is a classic. Give yourself a reload key.

bind r source-file ~/.tmux.conf \; display-message "Reloaded"

After the first manual reload with Ctrl-b : and source-file ~/.tmux.conf, Ctrl-b r reloads the file and shows a short message in the status bar.

The first time you add a line, you have to load it by hand with tmux source-file ~/.tmux.conf, or by pressing Ctrl-b : and typing the same command. The binding also shows a short confirmation, so you know the file loaded without errors.

If the file has a mistake, tmux reports it on reload, and the lines after the mistake may not apply. That is a good reason to reload often while you edit. Changing one thing and pressing Ctrl-b r tells you straight away which line caused the problem.

Options that only affect new windows, such as base-index, show up in windows you create after the reload, not in the ones that exist.

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 the session 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), On this site: tmux list-keys | grep finds the binding you forgot, On this site: set -g status-position top moves the tmux status bar to the top

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