I want to copy tmux selection inside system clipboard and found several solutions online. I grabbed this key bind configuration due to simplicity and added to my tmux.conf file.
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
Both key bindings works but terminal halts after triggering copy command key binding.
Here are my steps to copy selection:
- Prefix +
[ - Press space to mark selection
- Select text using arrow keys
- Prefix +
ctrl + c
At this point, the selection is available in system clipboard (tested it by pasting in other application). But the terminal window is not responding, even tried random keys but have no luck. I closed the terminal from x icon and open new window. The terminal behaves normally after reattaching to previous session in new window.
Most likely, I am doing something wrong but I'm unable to troubleshoot the bug.
Q. How can I troubleshoot and fix this problem?