Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: unicode in prompt breaks command search

On 1/16/20 8:25 PM, dana wrote:
On 16 Jan 2020, at 15:43, Nathan Sidwell <nathan@xxxxxxx> wrote:
For reasons, I put a multibyte unicode char in $PROMPT, this ends up messing
with zsh's idea of the current column, as it doesn't understand the display
width of $PROMPT.

You need to tell it what it is with the %{/%} and/or %G escape sequences. For
example, all of these are roughly equivalent and let zsh know that アイウエオ
takes up ten columns:


%{...%} without a leading digit or embedded %G is zero-width (useful for
invisible escape sequences).


(I don't think the behaviour of these sequences has changed since 5.2, but you
can check your zshmisc(1) to be sure)

On 1/17/20 3:23 AM, Roman Perepelitsa wrote:
Zsh can figure out how many columns Unicode characters take provided
that you configure locale correctly. The most common reason why Zsh
might think that every byte is one character is because the encoding
in the current locale is not UTF-8.

thanks for the pointers!

Nathan Sidwell

Messages sorted by: Reverse Date, Date, Thread, Author