Setting up tmux

Share on:

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!

  1. Install tmux
1sudo apt-get install -y tmux

Run the tmux application

Once installed, the application can be run from the command line.

  1. Start tmux
1tmux

Optional: Add a configuration

Adding a configuration to Tmux requires updating a number of files. The following example uses my configuration.

  1. Close ALL Tmux instances before continuing
1exit
  1. Move to the root/home directory
1cd ~
  1. Clone the repo into the home directory
1git clone https://github.com/rosera/machine-config.git
  1. Copy the tmux configuration files to the home directory
1cp -r ~/machine-config/tmux/.tmux* ~

Run the tmux application

  1. Remove the cloned repository
1sudo rm -r ~/machine-config
  1. Start tmux
1tmux

The status line will look like the image below: tmux statusline