tmux: clipboard copy and paste

Add into ~/.tmux.conf

set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind P paste-buffer

copy to clipboard

CTRL+B [ and then move cursor to start of area which you want to copy.

pres key v to make selection

when you select wanted text press key y

done: text is in clipboard

pres ESC and Enter to return back to promp

paste from clipboard

pres CTRL+B P