tmux-yank
tmux-yank copied to clipboard
Current time (fish_prompt_right) is included in yanked text
trafficstars
I use fish and have a "fish_prompt_right" defined. That means I see the current time at the end of every command line, for example:
~/workspace/tmux-yank (master|+2) ▶ vim yank.tmux 13:34:10
When I use PREFIX-y in order to copy the text current from the command line, the time and the spaces before are included.
I would like to remove them. I already tried adding this line into copy_line.sh, yank_current_line():
(xsel -b | sed -E 's/\ *[[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}//g' | xsel -b)
(Right before display_message 'Line copied to clipboard!').
But this doesn't work. The time is still included and tmux remains in copy mode. It works if I call this command in the terminal after yanking the current line.
What's wrong with my approach?