Usages of TMUX

 

TMUX could retain current working session. It’s pretty useful when you can’t have persistent connections to the remote server e.g. SSH login.

Key PRE

Default prefix (PRE as follows) is Ctrl + b. If we need to input PRE + D, first press D and hold; press Ctrl + b simultaneously and release all keys.

Basic concepts

  1. Session: different projects
  2. Window: different programs in the same project
  3. Panel: a few files which need to be compared at the same time

Operations for sessions

  1. create a new session:
    tmux new -s $session_name
    
  2. detach (quit) a session
    PRE + D
    or
    tmux detach
    
  3. check running sessions
    PRE + S
    or
    tmux ls
    
  4. attach (enter) a session
    tmux attach -t $session_name
    

Operations for windows

  1. create a new window
    PRE + c

  2. return to the previous window
    PRE + p

  3. go to the next window
    PRE + n

  4. go to the window with the specific number
    PRE + $number
    i.e. No.7 window
    PRE + 7

Operations for panels

  1. break current panel into left and right two panels
    PRE + %

  2. break current panel into up and down two panels
    PRE + "

  3. switch between different panels PRE + $arrow