Welcome back, my command-line enthusiasts! I’m sure many of you, like me, have experienced the joy of discovering a cool new setting in the Tmux configuration file and then the subsequent frustration of not knowing how to apply it without closing your sessions. Well, fret no more! In this blog post, I’m going to show you the magic command that lets you reload your Tmux config file without breaking your workflow. So let’s dive right in and start exploring!
Tmux beginners, don’t skip the basics of Tmux. Those already in the know, let’s jump into the deep end!
Let’s say you have made changes to tmux.conf
file by adding or changing default config, you have to reload the config so that the changes reflects in your terminal. The command to reload config is called source-file
.
Reload Tmux – Tmux Source Config
You have to reload tmux.conf
so that it reflects-
tmux source-file ~/.tmux.conf
If you are inside a tmux session, you can run the command inside the tmux session to source the config file-
prefix
:
source-file ~/.tmux.conf
By default the prefix is Ctrl-B
, so to reload the tmux conf you can run the following command-
Ctrl-B
:
source-file ~/.tmux.conf
Edit Tmux Config to create a shortcut – Ctrl-R
You can edit the tmux.conf
file to create a keyboard shortcut Ctrl-R
.
bind r source ~/.tmux.conf\\; display "~/.tmux.conf sourced!"
Going forward you can just do Ctrl-R
in your tmux, and enjoy instant tmux reload.
And there you go! You now know how to reload your Tmux config using the ‘tmux source-file’ command. No longer do you need to interrupt your work to apply a new setting. It’s little nuggets of knowledge like this that really help streamline our work and make Tmux such a powerful tool. So until next time, keep exploring and keep learning!
You can also check out the complete tmux cheatsheet of keyboard shortcuts and mouse shortcuts.