Sample Header Ad - 728x90

Yank trimmed string in tmux copy mode

0 votes
1 answer
115 views
I am trying to yank string without trailing and heading spaces using this keybinding: bind-key -T copy-mode-vi z send-keys -X \ copy-pipe 'sed "s/^[[:blank:]]\+//;s/[[:blank:]]\+$//" | xsel -ib' But it doesn't work, xsel -ob outputs string with spaces. So does Ctrl+V in GUI applications. Why? How can I achieve desired functionality? tmux 2.6, set-clipboard off **EDIT**: I've tested my sed expression and it works: igor@igor-ideapad:~$ echo " hello world " | sed "s/^[[:blank:]]\+//;s/[[:blank:]]\+$//" hello world
Asked by vatosarmat (252 rep)
Feb 15, 2020, 11:51 AM
Last activity: Feb 15, 2020, 02:30 PM