Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using a custom .tmux.conf file which looks like this:

unbind-key C-b
set -g prefix C-a
bind-key C-a send-prefix

set-window-option -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection

## CLIPBOARD selection integration
# Requires prefix key before the command key
# Copy tmux paste buffer to CLIPBOARD
bind C-y run "tmux show-buffer | xclip -i -selection clipboard"
# Copy CLIPBOARD to tmux paste buffer and paste tmux paste buffer
bind C-p run "tmux set-buffer -- \"$(xclip -o -selection clipboard)\"; tmux paste-buffer"

I'm using ctrl+a ctrl+y to copy from tmux copy buffer to clipboard. But every time I do this tmux freezes and does not accept any input. I tried to use ctrl+q but this doesn't help.

What can I do to prevent tmux from freezing, which shortcuts are interfering here? I also tried the shortcut ctrl+a ctrl+c, same problem here.

share|improve this question
    
please consider adding that to your question so it looks nice. –  Ash Oct 3 '13 at 13:29
add comment

1 Answer 1

If you type the xclip command on the command line you'll notice that it doesn't finish. This is because it continues to accept input until STDIN is done. Thus, STDOUT never gets closed. You can resolve this by redirecting the STDOUT of xclip to /dev/null. For example:

bind y run "tmux save-buffer - | xclip -selection clipboard &>/dev/null"

In this example I redirect STDERR as well just in case it matters.

share|improve this answer
add comment

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.