Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: unicode in prompt breaks command search
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:
PROMPT='%10{アイウエオ%}'
PROMPT='%{アイウエオ%10G%}'
PROMPT='%{%2Gア%2Gイ%2Gウ%2Gエ%2Gオ%}'
%{...%} without a leading digit or embedded %G is zero-width (useful for
invisible escape sequences).
http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Visual-effects
(I don't think the behaviour of these sequences has changed since 5.2, but you
can check your zshmisc(1) to be sure)
dana
Messages sorted by:
Reverse Date,
Date,
Thread,
Author