Difference between revisions for tmux
|
|
Next edit →
Revision 3 as of
08/05/2019 09:53
▼
4
08/05/2019 10:00
EvaggelosBalaskas
3
08/05/2019 09:53
EvaggelosBalaskas
2
07/16/2018 09:31
EvaggelosBalaskas
(2.2 KiB) +507 EvaggelosBalaskas |
tmux
tmux ~> Terminal MUltipleXer
architecture
session
windows
panes
<!--markup:2:begin-->
version
$ tmux -V
tmux 2.6
list
new session
attach
attach / detach
<!
<!--markup:1:end--> <!--markup:2:begin-->
tmux new -s session_name
creates a new tmux session named session_name
attaches to an existing tmux session named session_name
switches to an existing session named session_name
lists existing tmux sessions
detach the currently attached session
=== ReadOnly attach session ===
$ tmux attach -t session_ebal -r
=== synchronize panes === ctl + b
:setw synchronize-panes on
:setw synchronize-panes off
=== Capture Pane ===
ctrl+prefix a : capture-pane -S [lines]
will save the tmux pane into a buffer and after that
ctrl+prefix a : save-buffer /tmp/output
to save the buffer into a text file named output under /tmp directory === equally balance panes === ==== Vertically ====
:select-layout even-vertical
prefix + alt + 2
==== Horizontally ====
:select-layout even-horizontal
prefix + alt + 1
=== zoom into a pane ===
prefix + z
=== send-keys === eg. session:ebal
> tmux list-windows -t ebal |cut -d: -f1|xargs -I{} tmux send-keys -t ebal:{} clear C-m
=== reload config === **prefix + :**
:source-file /.tmux.conf
=== conf ===
$ vim /.tmux.conf
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
bind -n S-Up new-window
# Control + Arrow keys to pane switching
bind -n C-Up select-pane -U
bind -n C-Down select-pane -D
bind -n C-Left select-pane -L
bind -n C-Right select-pane -R
# Vertical Split – Control + v
bind -n C-v split-window
# Horizontal Split- Control + h
bind -n C-h split-window -h
%%