basic
session
- create new session:
tmux new -s name
- detach session:
ctrl+b d
- attach session:
tmux a -t name
- list session:
tmux ls
- kill session:
tmux kill-session -t session_id/session_name
window
- create window in session:
ctrl+b c
- switch window:
ctrl+b num
- delete window:
ctrl+b &
- rename window:
ctrl + b ,
panel
- create new pane in window:
ctrl+b shift+'
- arrange pane:
ctrl+b space
- switch pane:
ctrl+b arrow(up, down, left, right)
- max pane:
ctrl+b z
- delete pane:
ctrl+b x
https://linuxize.com/post/getting-started-with-tmux/
Advance hotkey:
triggle Home/End key:
vi ~/.tmux.conf
- add
bind -n End send-key C-e
bind -n Home send-key C-a
set -g mouse on
- reload tmux:
tmux source-file ~/.tmux.conf
https://stackoverflow.com/questions/18600188/home-end-keys-do-not-work-in-tmux
mouse scroll up/down:
ctrl+b
- type:
:
- enter:
set -g mouse on
https://github.com/xtermjs/xterm.js/issues/329#issuecomment-292895984
start on bash startup:
- Simply add the following line of bash code to your
.bashrc
before your aliases;
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
exec tmux new-session -A -s my_session_name
fi