最後更新: 2019-03-15
介紹
tmux is a terminal multiplexer
A session is a single collection of pseudo terminals under the management of tmux
Any number of tmux instances may connect to the same session,
and any number of windows may be present in the same session.
A status line at the bottom of the screen shows information on the current session
Session Management
tmux -V
tmux 2.3
tmux [new -s session_name]
tmux list-sessions # 縮寫: tmux ls
tim: 1 windows (created Fri Mar 15 16:39:42 2019) [80x23] (attached)
tim = session_name
tmux detach (prefix + d)
Default prefix: Ctrl+B
tmux attach [-t session_name]
進階
Default prefix: Ctrl+B
設定檔
- /etc/tmux.conf
- ~/.tmux.conf
window
- c # Create a new window.
- n # Change to the next window
- p # Change to the previous window
- 0 to 9 # Select windows 0 to 9
- & # Kill the current window
pane
- " # Split the current pane into two(top and bottom)
- % # Split the current pane into two(left and right)
-
q # Briefly display pane indexes.
- ; # Move to the previously active pane.
-
o # Select the next pane in the current window.
- C-o # Rotate the panes
- x # Kill the current pane.
- ! # Break the current pane out of the window.