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

Re: Right-arrow character and autocomplete



On Mon, Oct 11, 2021 at 5:15 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> On Mon, 11 Oct 2021 at 14:05, Darío Cuevas <superdarion@xxxxxxxxx> wrote:
>>
>> To reproduce, one
>> needs only do PROMPT="→" on .zshrc, open a terminal, start typing some
>> command (e.g. ls) and hit TAB: the command (ls) will be written twice.
>
> This usually happens when you put non-ascii characters in PROMPT (like that arrow) but your locale is not UTF-8. Run `locale` to confirm. To fix this, install and enable a UTF-8 locale.

Although that's the best solution, if for some reason that can't be
done you can try using the "glitch" prompt escape to tell zsh what the
actual character width is.

PROMPT="%1{→%}"

tells zsh that although there are 3 bytes in the %{...%} sequence, it
should be treated as occupying only one character position.




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