Setting up tmux
Introduction
Tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal. If you work at the command line, manage multiple machines or work in the Cloud you will definitely want to investigate using a terminal multiplexer. I have found Tmux to be incredibly useful for a wide variety of usecases e.g. Kubernetes, SSH sessions and general development.
Set up TMUX
Setting up Tmux is super easy!
- Install tmux
1sudo apt-get install -y tmux
Run the tmux application
Once installed, the application can be run from the command line.
- Start tmux
1tmux
Optional: Add a configuration
Adding a configuration to Tmux requires updating a number of files. The following example uses my configuration.
- Close
ALL
Tmux instances before continuing
1exit
- Move to the root/home directory
1cd ~
- Clone the repo into the home directory
1git clone https://github.com/rosera/machine-config.git
- Copy the tmux configuration files to the home directory
1cp -r ~/machine-config/tmux/.tmux* ~
Run the tmux application
- Remove the cloned repository
1sudo rm -r ~/machine-config
- Start tmux
1tmux
The status line will look like the image below: