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?
CTRL+SHIFT+C
shortcut doesn't work. First, the mouse selection disappears as soon as I leave the left click and I have even tried holding the left click but did not worked. However, I found working solution in suggested question. – Alena Sep 21 '21 at 07:09tmux
version is, but if just using your mouse to copy paste sounds like a good option to you, check out this answer by GMaster. It applies to MacOS and to Linux platforms. – Cbhihe Sep 21 '21 at 07:54