4

I am trying to copy from tmux to my browser. I followed the post

Copying between tmux buffers and the system clipboard which tells me to add

setw -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard"

. My new ~/.tmux.conf looks like the below one :

setw -g mode-keys vi
set -g mode-mouse on
set-option -g status on
set-option -g status-interval 2
set-option -g status-utf8 on
set-option -g status-justify "centre"
set-option -g status-left-length 60
set-option -g status-right-length 90
set-option -g status-left "#(~/tmux-powerline/powerline.sh left)"
set-option -g status-right "#(~/tmux-powerline/powerline.sh right)"

set-window-option -g window-status-current-format "#[fg=colour235, bg=colour27]?#[fg=colour255, bg=colour27] #I ? #W #[fg=colour27, bg=colour235]?"
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard"

After setup, I tried

  1. Ctrl-b [ (before copy mode)
  2. v (copy mode)
  3. y (yank)
  4. Ctrl-b y (to move to system buffer)
  5. Goto browser and paste with Ctrl-v

Seems working upto SETP 4 as I see the message

Copied tmux buffer to system clipboard

But pasting somewhere (STEP 5) else is not working.

I am using ubuntu 12.04.

  • Does Shift+Insert to paste work? – jasonwryan Jan 13 '14 at 19:18
  • @jasonwryan no Shift+Insert doesn't work. – prayagupd Jan 14 '14 at 3:54
0

I have the same configuration as you and it is working.

# Use vim keybindings in copy mode
setw -g mode-keys vi
bind [ copy-mode
unbind ]
bind ] paste-buffer

bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard"

Make sure to reload your tmux configuration file with the command:

:source-file ~/.tmux.conf

Or from the shell

tmux source-file ~/.tmux.conf

You can also make a shortcut for that :

# reload .tmux.conf 
bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded"
  • It's seems working upto Step 4, but Ctrl-v in other editors or browsers is not working. – prayagupd Jan 13 '14 at 15:58
0

Same conf (https://github.com/iPrayag/dotfiles/blob/master/.tmux.conf) in June 2014 is working. \,,/ Could be mismatch in configuration before.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.