---
title: tmux
category: CLI
+layout: 2017/sheet
---
### Commands
$ tmux new -s session_name
$ tmux attach # Default session
- $ tmux attach -s session_name
+ $ tmux attach -t session_name
$ tmux switch -t session_name
### Panes
- C-b v # vert
- C-b n # horiz
+ C-b % # vert
+ C-b " # horiz
C-b hkjl # navigation
C-b HJKL # resize
C-b o # next window
+ C-b q # show pane numbers
C-b x # close pane
C-b { or } # move windows around
C-b c # New window
C-b 1 # Go to window 1
+ C-b n # Go to next window
+ C-b p # Go to previous window
+ C-b w # List all window
### Detach/attach
### Attribute/colors
+| Key | Description |
+| --- | --- |
| `#[fg=1]` | standard color |
| `#[fg=yellow]` | yellow |
| `#[bold]` | bold |
### Variables
+| Key | Description |
+| --- | --- |
| `#(date)` | shell command |
| `#I` | window index |
| `#S` | session name |