我正在MacBook Pro上运行Ubuntu Trusty64 Vagrant Box
。其中已安装tmux 1.8
。
我的tmux.conf
如下:
set -g default-terminal "screen-256color"
set-window-option -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-select-window on
set -s escape-time 50
setw -g mode-mouse on
set -g mouse-select-window on
bind-key c command-prompt -p "window name:" "new-window; rename-window '%%'"
bind -t vi-copy c copy-pipe 'xclip -in -selection clipboard'
set-window-option -g mode-keys vi
bind-key Escape copy-mode # enter copy mode; default [
bind-key -t vi-copy Escape cancel # exit copy mode; or hit q
bind-key p paste-buffer # paste; default ]
bind-key -t vi-copy v begin-selection # begin visual mode
bind-key -t vi-copy V select-line # visual line
bind-key -t vi-copy y copy-selection # yank
bind-key -t vi-copy r rectangle-toggle # visual block toggle
bind-key < command-prompt -p "send to tmux:" "run-shell 'tmux set-buffer -- \"$(xsel -o -b)\"'"
bind-key > command-prompt -p "send to xsel:" "run-shell 'tmux show-buffer | xsel -i -b'"
bind-key + command-prompt "delete-buffer"
它工作正常,除了没有任何东西被复制到系统剪贴板(Ubuntu VM或MacBook Pro)上。我已经尝试过xclip
和xsel
两者。为什么会这样?