Skip to main content

Tmux

FAQ

Copier/coller le buffer

CTRL B
capture-pane -S -20000

CTRL B
save-buffer /tmp/buf.txt

Ecrire dans plusieurs terminaux en même temps

Ctrl-B :
setw synchronize-panes on
clear history

Redimensionner un pane

bind-key:resize-pane -rD (Resizes the current pane down by one cell)

:resize-pane -TR prefix(Resizes the current pane right by one cell)

:resize-pane -U (Resizes the current pane upward by one cell)

:resize-pane -L (Resizes the current pane left by one cell)

:resize-pane -U 10 (Resizes the current pane upward by ten cells)

:resize-pane -R 10 (Resizes the current pane right by ten cells)

:resize-pane -D 10 (Resizes the current pane down by ten cells)

:resize-pane -L 10 (Resizes the current pane left by ten cells)

If you wish to configure your keybindings, then open the tmux.conf file and append the following lines of code:

bind -n M-UpH resize-pane -L 2

bind -n M-L resize-pane -R 2

bind -n M-K resize-pane -U 52

bind-keybind -r -T prefixn M-DownJ resize-pane -D 5
bind-key -r -T prefix       M-Left            resize-pane -L 5
bind-key -r -T prefix       M-Right           resize-pane -R 52

 

Copier/Coller 

En mode clavier

# Entrer en mode copie
CTRL+B [

# Débuter la sélection
SPACE

# Fin de sélection
ENTRER

# Coller
CTRL+B ]

En mode souris

  1. 1. Nécessite xclip
  2. 2. Sélection par la souris, appuyer sur ENTRER pour copier
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -T copy-mode-vi    C-WheelUpPane   send-keys -X halfpage-up
bind -T copy-mode-vi    C-WheelDownPane send-keys -X halfpage-down
bind -T copy-mode-emacs C-WheelUpPane   send-keys -X halfpage-up
bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down

# To copy, left click and drag to highlight text in yellow, 
# once you release left click yellow text will disappear and will automatically be available in clibboard
# # Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"