Skip to main content

tmux

Sessions

Start session

  • tmux new
  • tmux new -s mysession

Show sessions

  • tmux ls

Kill sessions

  • tmux kill-session  -t mysession
  • tmux kill-session -a  ;kill all sessions but last session

Attach sessions

  • tmux a
  • tmux a -t #
  • tmux a -t mysession
Keyboard
    Tmux Cheat Sheet

    PREFIX: CTRL+b

    sessions

    • Detach from session: PREFIX + d
    • Rename session: PREFIX + $
    • Move to previous session: PREFIX + (
    • Move to next session: PREFIX + )

    Windows

    • Create a new window: PREFIX + c
    • Rename the window: PREFIX + ,
    • Move the window: PREFIX + {window-number}
    • Close current window: PREFIX + &
    • Move to previous window: PREFIX + p
    • Move to next window: PREFIX + n
    • Go to any window: PREFIX + s

    Panes

    • Split panes horizontally: PREFIX + "
    • Split panes vertically: PREFIX + %
    • Switch between panes: PREFIX + Left/Right/Up/Down

    Copy Mode

    • Enter copy mode: PREFIX + [
    • Exit copy mode: q
    Configuration

    .tmux.conf

    # Enable 256 color in terminal
    set -g default-terminal "tmux-256color"
    
    # Fix the dynamic title name
    set-option -g allow-rename off
    FAQ

    Window 無法固定標題名稱

    Solution: ~/.tmux.conf

    set-option -g allow-rename off


    Learn