You also close the simultaneous remote terminal sessions when you end an SSH connection. Tmux comes in handy here since it saves those sessions after the SSH connection is ended. Tmux is a terminal multiplexer that is free and open source.
It allows you to manage multiple terminal windows at the same time. People who have used the Terminal application before will be familiar with the concept of tab management in Linux Terminal.
Tmux allows us to divide the terminal into many windows. We can move, resize, and switch between these panes to make them fit our needs. This alleviates the strain of handling several Gnome terminal windows and tabs.
Note: Once you install Tmux, you will not see it as an icon just like other applications; hence we need the terminal to invoke it.
This article tutorial will look at installing and launching Tmux, particularly “How to Reload a Tmux Configuration File.” For this guide, we will utilize Ubuntu 22.04 as the base system.
We shall only brush through the installation and launching process as it has already been covered in one of our articles.
Launch your terminal and execute this command:
sudo apt-get install tmux
Alternatively, you can launch the software center, search for Tmux, and install it.
Launching Tmux is alternatively easy. Run this command to fire it up:
Tmux config file reloading
When we modify Tmux to meet our demands, we must reload the config file. In this segment, we will go over three possible methods for reloading the Tmux configuration file:
1. Using the command “tmux source-file,” reload the Tmux configuration file.
To reload tmux.conf from the shell prompt, use the following command:
tmux source-file <path to the tmux.conf file>
If the file is located in the user’s home directory (which is generally the case), the command will be:
tmux source-file ~/.tmux.conf
2. Using the Tmux command prompt, reload the Tmux config file.
We may alternatively utilize the Tmux command prompt to begin the reloading process. To accomplish this, press “Prefix +:” and then enter the following command into the command prompt:
Note: the prefix is “Ctrl+b”
This loads the configuration file from within a Tmux session currently operating.
3. Reloading the Tmux configuration file with a prefix and key combination
We need to change the Tmux configuration file regularly, and many individuals find it tedious to type the “source-file” command repeatedly. Let’s make a quick shortcut for this. Open the tmux.conf file with your favorite text editor. In this example, we shall use nano:
Then add the following line to it, then reload the Tmux configuration file:
bind r source-file ~/.tmux.conf
You need to input the prefix followed by “r” the next time you ought to reload the config file.
That’s all. You have successfully learned how to reload a Tmux config file.
If you are wondering how to use this Tmux application, then don’t freak out since below is a summarized way of using it:
How to use Tmux
To transmit commands to a Tmux terminal, we have three options:
- Using Prefix Keys: Tmux employs a key combination known as prefix keys, which are by default “CTRL+b.” This prefix is accompanied by one or two more keys that Tmux will interpret for a specific operation. We can list active sessions, for example, by typing [Prefix+s].
- To transmit instructions straight to the Tmux terminal, we must first enter the command mode by hitting the prefix keys followed by a colon (:). To input the Tmux instructions, a command prompt will appear at the bottom of the terminal.
- Tmux commands can also be executed from a non-Tmux terminal or shell prompt. These instructions are prefixed by the term “tmux.”
This short article guide has covered everything one needs to know to reload a Tmux config file. We hope you found it helpful. If yes, let us know your encounter via the comments section below. Thanks for reading.
We have no tolerance for comments containing violence, racism, profanity, vulgarity, doxing, or discourteous behavior. Thank you for partnering with us to maintain fruitful conversation.