Inertia

tmux

When you are working with remote compute, usally you use SSH. It is secure and easy. but when you are working with long running task, your ssh session will be disconnected. to prevent this kind of inproductivity, tmux comes in.

session

tmux has session. this session will be persistent as long as the remote computer is alive. You can completely restore your context-command histroy, current directory, running progrm.

1
2
3
4
5
6
tmux new -s default # new session
tmux ls

tmux attach -t <session>
tmux> quit # terminate session
tmux> tmux detach # detach current session. session is not terminated

window

pane

window can be splitted into several panes. tmux can store/restore panes.

1
2
3
prefix + \" : split active pane horizontally
prefix + arrow key : switch to another pane
prefix + o : move to next pane

shortcut

1
2
prefix : ctrl + b
prefix + d : detach session

screen scroll

prefix + [ will initiate scroll move mode. you can use down/up, /(keyword search), pageup/pagedown to move your scren buffer. by pressing ‘q’ or ‘enter’ you can termiate this mode.

iTerm2 integration

1
2
tmux -CC            # create new tmux session
tmux -CC attach # attach to existing session