MyWackoSite: terminal multiplexer

https://wiki.ebal.gr     Version: 4 (08/05/2019 10:00)

terminal multiplexer

tmux


tmux ~> Terminal MUltipleXer

architecture


session 
    windows
        panes		

version


BASH
$ tmux -V
tmux 2.6

list



new session



attach



attach / detach



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



# Improve colors
set -g default-terminal 'screen-256color'

# Set scrollback buffer to 10000
set -g history-limit 10000

# Customize the status line
set -g status-fg  green
set -g status-bg  black