tmux چیٹ شیٹ
قابل تلاش، قابل پرنٹ tmux حوالہ: سیشنز، ونڈوز، پینز، کاپی موڈ، پریفکس ری بائنڈنگ، کنفیگریشن، پلگ انز اور اسکرپٹنگ۔ مفت۔
Sessions
11tmux new -s work
tmux new -s work -d
tmux new -As work
tmux ls
tmux attach -t work
Prefix d
Prefix $
Prefix s
Prefix ( / )
tmux kill-session -t work
tmux kill-server
Windows
10Prefix c
Prefix ,
Prefix n / p
Prefix 0..9
Prefix l
Prefix w
Prefix f
Prefix &
Prefix .
swap-window -s 2 -t 0
Panes
12Prefix %
Prefix "
Prefix arrow keys
Prefix o / ;
Prefix q
Prefix z
Prefix x
Prefix { / }
Prefix Ctrl+arrow
Prefix Space
Prefix !
join-pane -s 2 -t 1
Copy mode & scrolling
11Prefix [
q / Escape
Prefix PgUp
Space then Enter
v then y
Prefix ]
/ and ?
n / N
g / G
setw -g mode-keys vi
tmux capture-pane -p > out.txt
Prefix key & rebinding
9Ctrl+b
Prefix key, then the command key
set -g prefix C-a
unbind C-b
bind C-a send-prefix
bind r source-file ~/.tmux.conf
bind -n M-Left select-pane -L
bind -r H resize-pane -L 5
tmux list-keys
Command mode (:)
9Prefix :
:new-window -n logs
:split-window -h
:rename-session dev
:setw synchronize-panes on
:swap-pane -s 0 -t 1
:resize-pane -D 10
:source-file ~/.tmux.conf
:kill-server
Configuration essentials
11set -g mouse on
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
setw -g mode-keys vi
set -g history-limit 50000
set -g default-terminal "tmux-256color"
set -sg escape-time 0
bind | split-window -h
bind - split-window -v
set -g focus-events on
Plugins & TPM
10git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
set -g @plugin 'tmux-plugins/tpm'
run '~/.tmux/plugins/tpm/tpm'
Prefix I
Prefix U
Prefix Alt+u
@plugin 'tmux-plugins/tmux-resurrect'
@plugin 'tmux-plugins/tmux-continuum'
@plugin 'tmux-plugins/tmux-yank'
@plugin 'tmux-plugins/tmux-sensible'
Sharing & pairing
8tmux -S /tmp/pair new -s pair
chmod 777 /tmp/pair
tmux -S /tmp/pair attach
tmux attach -t work -r
Two clients, one session
tmux new -s me -t work
ssh user@host -t tmux new -As dev
setw -g aggressive-resize on
Scripting from the shell
10tmux new -d -s job 'npm run build'
tmux send-keys -t job 'ls -la' Enter
tmux send-keys -t job C-c
tmux has-session -t job 2>/dev/null && echo up
tmux capture-pane -t job -p
tmux split-window -t job -h 'htop'
tmux select-window -t job:2
tmux display-message -p '#S'
tmux list-panes -a
tmux wait-for done
Status bar
10set -g status off
set -g status-position top
set -g status-style bg=black,fg=white
set -g status-left '[#S] '
set -g status-right '%H:%M %d-%b'
set -g status-interval 5
setw -g window-status-current-style fg=green
#S #I #W #P #H
#(uptime | cut -d, -f1)
set -g status-justify centre
Troubleshooting
10tmux -V
tmux info
tmux show-options -g
Config changes not applied
Prefix : source-file ~/.tmux.conf
"sessions should be nested with care"
TERM=xterm-256color tmux
Esc feels laggy in vim
tmux kill-server
Sessions gone after reboot
کوئی اندراج “:q” سے میل نہیں کھاتا۔
tmux چیٹ شیٹ کے بارے میں
یہ tmux چیٹ شیٹ کی بائنڈنگز اور کمانڈز ایک قابل تلاش صفحے پر جمع کرتی ہے: سیشنز، ونڈوز، پینز، کاپی موڈ اور سکرولنگ، پریفکس کی اور اسے دوبارہ بائنڈ کرنا، کمانڈ موڈ، کنفیگریشن کی ضروری باتیں، پلگ انز اور TPM، شیئرنگ اور پیئرنگ، شیل سے اسکرپٹنگ، سٹیٹس بار، اور مسائل کا حل۔
tmux تقریباً مکمل طور پر ایک پریفکس کی پر بنی عضلاتی یادداشت ہے، اس لیے شیٹ ہر بائنڈنگ کو پریفکس جمع کی کے طور پر دکھاتی ہے، اور جہاں موجود ہو وہاں مساوی شیل کمانڈ بھی، جو تب کام آتی ہے جب آپ سیشن کو ہاتھ سے چلانے کے بجائے اسکرپٹ کر رہے ہوں۔
اس گروپ کی ہر چیٹ شیٹ کی طرح یہ مفت اور کلائنٹ سائیڈ ہے: سرچ باکس سے قطاروں کو لائیو فلٹر کریں، چپکے رہنے والی فہرست مضامین سے حصوں کے درمیان کودیں، ایک کلک سے کوئی بھی کمانڈ کاپی کریں اور اپنے ٹرمینل کے پاس حوالے کے لیے صفحہ پرنٹ کریں۔
tmux چیٹ شیٹ استعمال کرنے کا طریقہ
- شیٹ کھولیں اور حصوں کا جائزہ لیں، Sessions اور Windows سے لے کر Troubleshooting تک۔
- split، detach یا copy جیسا کوئی کلیدی لفظ تلاش کریں تاکہ ہر قطار لائیو فلٹر ہو جائے۔
- جب آپ پریفکس یا پین بائنڈنگز بدلنا چاہیں تو Configuration essentials پر جائیں۔
- کمانڈ کو براہ راست اپنے ٹرمینل یا .tmux.conf میں کاپی کرنے کے لیے اس پر یا اس کے کاپی آئیکن پر کلک کریں۔
- مکمل tmux حوالے کی کاغذی کاپی کے لیے Print استعمال کریں۔