tmux-copycat
tmux-copycat copied to clipboard
Bug when highlighting a match in zsh shell prompt
If a user has sophisticated zsh shell prompt with unicode characters, match selection could be buggy.
Example: zsh shell prompt contains unicode chars and current directory path. File search (prefix + C-f) highlights the directory path invalidly. Presumably, this is because of unicode characters.
This is indeed an issue and it affects me. Consider the following text:
11:12 ircuser123 │ check out my super cool link! http://example.com :D
11:13 ircuser123 │ is anybody there?
In principle, <prefix> ctrl-u
should highlight http://example.com
. Instead, due to the multibyte character │
earlier in the line, it selects the rather less useful tp://example.com :
. The behaviour becomes even more destructive when the URL appears at the end of the line; the selection will include the newline character, plus characters from the next line. Very annoying, especially when used with tmux-open.
@bruno- I'd like to take a stab at fixing this... can you point me toward the code responsible for finding the boundaries of the search item?
Hey,
the solution for this seems to be installing gawk
as indicated in the readme install section.
gawk
has better unicode handling so we made this a drop-in replacement for awk
. Once you install it everything should work ok. If you try this please leave feedback, thx.
Yup, that seems to take care of it. Thanks!
Hi guys, it's still not completely solved, not working well with CJK characters.
朕吞玻璃不伤身体 11:12 ircuser123 │ check out my super cool link! http://example.com :D
Paste this in your tmux and try prefix + <C-u>
. Here is what I got:

not working well with CJK characters
I tested your line and I can reproduce the issue. Not sure how to solve it though. Using gawk
was the best approach till now.