Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
Does Shift+Insert to paste work? –  jasonwryan Jan 13 at 19:18
    
@jasonwryan no Shift+Insert doesn't work. –  Prayag Upd Jan 14 at 3:54

2 Answers 2

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"
share|improve this answer
    
It's seems working upto Step 4, but Ctrl-v in other editors or browsers is not working. –  Prayag Upd Jan 13 at 15:58
up vote 0 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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