Sunday, May 17, 2026

tmux

                                                                                                                              

contrl b; s 


  Sessions

                                                                                                                             

  ┌───────────────────────────┬────────────────────────┐

  │          Command          │      Description       │                                                                     

  ├───────────────────────────┼────────────────────────┤

  │ tmux new -s name          │ Create a named session │

  ├───────────────────────────┼────────────────────────┤

  │ tmux ls                   │ List sessions          │

  ├───────────────────────────┼────────────────────────┤

  │ tmux attach -t name       │ Attach to a session    │

  ├───────────────────────────┼────────────────────────┤

  │ tmux kill-session -t name │ Kill a session         │

  └───────────────────────────┴────────────────────────┘


  Key Bindings (prefix: Ctrl+b)


  Windows (tabs)


  ┌───────┬────────────────────────────┐

  │  Key  │        Description         │

  ├───────┼────────────────────────────┤

  │ c     │ Create new window          │

  ├───────┼────────────────────────────┤

  │ n / p │ Next / previous window     │

  ├───────┼────────────────────────────┤

  │ 0-9   │ Switch to window by number │

  ├───────┼────────────────────────────┤

  │ ,     │ Rename window              │

  ├───────┼────────────────────────────┤

  │ &     │ Close window               │

  └───────┴────────────────────────────┘


  Panes (splits)


  ┌────────────┬───────────────────────────────┐

  │    Key     │          Description          │

  ├────────────┼───────────────────────────────┤

  │ %          │ Split vertically              │

  ├────────────┼───────────────────────────────┤

  │ "          │ Split horizontally            │

  ├────────────┼───────────────────────────────┤

  │ Arrow keys │ Move between panes            │

  ├────────────┼───────────────────────────────┤

  │ x          │ Close pane                    │

  ├────────────┼───────────────────────────────┤

  │ z          │ Toggle pane zoom (fullscreen) │

  ├────────────┼───────────────────────────────┤

  │ Ctrl+Arrow │ Resize pane                   │

  └────────────┴───────────────────────────────┘


  Session Control


  ┌─────┬──────────────────────┐

  │ Key │     Description      │

  ├─────┼──────────────────────┤

  │ d   │ Detach from session  │

  ├─────┼──────────────────────┤

  │ s   │ List/switch sessions │

  ├─────┼──────────────────────┤

  │ $   │ Rename session       │

  └─────┴──────────────────────┘


  Typical Workflow


  tmux new -s work          # start a session

  # do stuff, split panes, etc.

  # press Ctrl+b d           # detach

  tmux attach -t work       # reattach later

No comments:

Post a Comment