sudo apt install tmux
get into tmux without a given name
tmux
Session
| Window
| | Pane
-
Hit [ Ctrl + B ] to wait for short-cut keys
-
Then, press the short-cut keys to do what you want
Hot key Function %
create a new pane horizontally "
create a new pane vertically RIGHT
LEFT
UP
DOWN
switch between panes o
switch pane x
close the pane !
kill all other panes,
keep the current onlyq
show the number of panes Hot key Function c
create a new window ,
rename the window w
show the window NUM
select the window p
to the previous n
to the next Hot key Function :new Session name
create a new session
with the given name$
rename current session s
switch session d
detach session
(minimize, not kill)Ctrl+z
hang on the session, return to bash
- activate mouse
tmux set -g mouse on
- view the running tmux sessions
tmux ls
- get back to the tmux session
all the stuff would be preserved
tmux attach -t ${SessionID}
to QUIT but NOT KILL the session:
Ctrl + B: Ctrl + Z - rename tmux session OUT IN HOST terminal
tmux rename-session -t ${SessionID} ${SessionName}
- create a new session OUT IN HOST terminal
with a specified name:
without given name, the session can be reached through ID by default
tmux new -s ${SessionName}
tmux
- kill sessions that we don't use anymore
tmux kill ${SessionID/SessionName}