tmux

Tmux is an open-source terminal multiplexer that replaces the GNU screen. It allows you to access multiple terminal sessions simultaneously in a single window. You can run more than one command-line program at the same time and easily switch between multiple programs in one terminal. This terminal session protects your programs from accidentally disconnecting by decoupling them from the main terminal. Also, it is scriptable which lets you create custom tmux sessions for different purposes.

Install (Debian)

sudo nala install tmux -y

Install (Homebrew)

brew install tmux

Using tmux

tmux

Create a new session:

tmux new-session -s <your_session_name>

View available sessions:

tmux list-sessions

Detach from your session:

tmux detach

Reattach to your session:

tmux attach -t <your_session_name>

Kill all other sessions

tmux kill-session -a

Split windows vertical or horizontal

split-window -v \; split-window -h \;

Install plugins

Press Ctrl+b (prefix) + I (capital i, as in Install) to fetch the plugin.

Keyboard shortcuts

  • Ctrl-b ?: Show all commands
  • Ctrl+b c: Create a new window
  • Ctrl-b o: Switch
  • Ctrl+b arrow key: Switch pane
  • Ctrl+b “: Split horizontally
  • Ctrl+b %: Split vertically
  • Ctrl+b n: Next
  • Ctrl+b p: Previous

GitHub - tmux/tmux: tmux source code
tmux source code. Contribute to tmux/tmux development by creating an account on GitHub.
Tmux Cheat Sheet & Quick Reference
Master tmux with our comprehensive cheat sheet: latest shortcuts, quick reference, examples, and installation guide for the ultimate terminal multiplexer.