TMUX Manual


What is tmux?

  1. tmux = terminal multiplexer


  2. That means it lets one terminal process (the tmux server) manage many sessions, windows, and panes,
    all inside the same terminal emulator (like Kitty, Alacritty, Konsole, etc.).


  3. So tmux is inside your terminal — not another terminal emulator.



The real reasons people use tmux

  1. Persistence: If you close your terminal or lose your SSH session, everything inside tmux keeps running.
  2. # Start a session
    tmux new -s work
    
    # Do your stuff...
    # Lose connection? No problem.
    
    # Reattach later
    tmux attach -t work
    


  3. Multiple panes / windows in one terminal.


  4. Session management: You can have multiple sessions (e.g., one per project).
  5. tmux new -s projA
    tmux new -s projB
    tmux ls
    tmux attach -t projA
    


  6. Automation and scripting: tmux can run commands on startup (from .tmux.conf or scripts):
  7. tmux new-session -d -s dev
    tmux new-window -t dev:1 -n "server" "npm run dev"
    tmux new-window -t dev:2 -n "logs" "tail -f /var/log/syslog"
    tmux attach -t dev
    



Tmux: Sessions, Windows, and Panes

  1. Sessions: groups of windows


  2. Windows: tabs inside a session


  3. Panes: splits inside a window


  4. Starting and Attaching Sessions
  5. tmux
    # Starts a new unnamed session.
    

    tmux new -s mysession
    


    tmux attach -t mysession
    


    tmux ls
    



  6. Detaching from a Session
  7. Ctrl-b d
    



  8. Working with Sessions
  9. tmux rename-session -t <oldname> <newname>
    tmux kill-session -t <mysession>
    



  10. Windows: Tabs Inside a Session (A window is like a browser tab inside your tmux session)

  11. Ctrl-b c
    

    Ctrl-b w
    

    Ctrl-b n   # next window
    Ctrl-b p   # previous window
    
    Ctrl-b ,   # rename the current window
    


  12. Useful Window Commands
  13. tmux new-window -n editor
    tmux kill-window -t 2
    tmux select-window -t 1
    



  14. Panes: Splits Inside a Window



  15. Ctrl-b %
    


    Ctrl-b "
    


    Ctrl-b x
    


    Ctrl-b o
    


    Ctrl-b ;
    



  16. Resizing Panes
  17. Ctrl-b Ctrl-arrow keys
    


    Ctrl-b : resize-pane -L 10
    Ctrl-b : resize-pane -R 10
    



  18. Synchronize Panes
  19. Ctrl-b :
    set-window-option synchronize-panes on
    



  20. Moving Panes and Converting Between Panes and Windows
  21. Ctrl-b !
    


    Ctrl-b :
    join-pane -s 2 -t 1
    



  22. Zooming a Pane
  23. Ctrl-b z
    



  24. Layouts (Auto-arranging Panes)
  25. Ctrl-b space
    



  26. Quick Overview of Key Bindings

  27. Feature Shortcut Description
    Create session tmux new -s name Start a named session
    Detach Ctrl-b d Detach from session
    New window Ctrl-b c Create a new window
    Next/previous window Ctrl-b n / Ctrl-b p Navigate windows
    Vertical split Ctrl-b % Split pane vertically
    Horizontal split Ctrl-b " Split pane horizontally
    Switch pane Ctrl-b o Move to next pane
    Resize pane Ctrl-b Ctrl-arrow Resize active pane
    Zoom Ctrl-b z Toggle fullscreen pane
    Kill pane Ctrl-b x Close current pane