Reloading config from inside tmux
tmux's prefix key
The default tmux prefix key is Ctrl-b, for the remainder of this
article, we will refer to the prefix key as
prefix,key means pressing
prefix and the key after
the prefix is released.
When tmux first starts, it will check for a file called
$HOME/.tmux.conf. Sometimes you may see people refer to it as
~/.tmux.conf (same thing), or "
You can kill all tmux sessions with the command
$ killall tmux.
You can kill your current session from inside tmux with
$ tmux kill-sess. If it's your last session, it will stop the tmux
Then you can use the
$ tmux command again to start a new tmux
However, there is an easier way to reload tmux configurations.
While inside a tmux session, you can set keybindings via
$ tmux bind-key and it will set to your current tmux's config.
You can also set options with
$ tmux set-option and
$ tmux set-window-option.
This is valuable for experimenting with bindings and settings. However these settings will not carry over to other tmux instances. To do that, you must save any bindings or options inside the tmux config.
prefix,: will replace the status bar at the bottom tmux with a prompt
where you can enter text. From the prompt, this command reloads
.tmux.conf in the home directory:
Enter. This manually reruns the configuration file in the
current tmux instance.
You can use the above command with any tmux file. For instance
~/.tmux.conf file, this binds leader+r to reload the
configuration and display a message "Config reloaded...":
# reload config bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."