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 reads its config from ~/.config/tmux/tmux.conf too

Tmux
~/tips/tip-tmux-xdg-config-path

mkdir -p ~/.config/tmux

Lets you keep the tmux config with your other dotfiles.

Since version 3.1, tmux doesn’t insist on ~/.tmux.conf. It also looks in the place where most modern tools keep their settings.

mkdir -p ~/.config/tmux
mv ~/.tmux.conf ~/.config/tmux/tmux.conf

If XDG_CONFIG_HOME is set, tmux uses $XDG_CONFIG_HOME/tmux/tmux.conf instead. I like that when ~/.config lives in a Git repository and want everything in one tree.

Restart the server with tmux kill-server, or reload by hand, to pick up the file. Any reload binding that names the old path needs updating as well:

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

Don’t keep both files. With tmux 3.8, a quick test with a temporary home folder showed that both got loaded, one after the other, so a stale ~/.tmux.conf can quietly undo or duplicate settings. Delete the old one once you moved.

Older versions, like the 3.0 in some long term support distributions, only read ~/.tmux.conf. If you share the config with such a machine, a symlink from ~/.tmux.conf is the easy way to serve both.

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