Tmux - Awesome Tool for Efficient Work

1 minute read

Published:

This is about tmux — Terminal Multiplexer for newbies such as me.

Concepts

  • Shell env could start multiple tmux sessions
  • A session could start multiple windows which could be compared to virtual desktops
  • A window (usually assigned with a number) could contain multiple panes
  • A Pane is the part which you directly work with

Commands on Sessions

  • Begin with a shell env
  • tmux new -s(ession) session_name, start and come into a tmux session env named ‘session_name’
  • C-b d(etach), back to shell env, while holding tmux sessions background
  • tmux ls (in sell env), C-b s(ession) (in tmux session env), list running sessions
  • tmux a(ttach) -t(arget) session_name, come into session env from shell env
  • tmux kill-session -t session_name, tmux rename -t old_name new_name, C-b $new_name

Commands on Windows

  • C-b c(reate), create a window env (in a session env)
  • C-b w(windows), list all windows in the current session
  • C-b n(ext)/p(revious)/0/l, switch windows
  • C-b &, close current window

Commands on Panes

  • C-b %, split current pane vertically
  • C-b ", split current pane horizontally
  • C-b o/up/down/left/right, swith pane
  • C-b x, close current pane
  • C-b PGUP/PGDN, look through input/output history

Others?

Before C-b, an Esc might be necessary