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

Re: UNICODE Private Use Area characters in BUFFER



On 10/23/22, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
> Zle cannot display UNICODE Private Use Area characters in BUFFER.
>
>     % f() BUFFER=$'\uE0B0'
>     % zle -N f
>     % bindkey '^T' f
>     % <Ctrl-T>
>
> Expected: the last line shows the glyph for U+E0B0 (whichever way the
> terminal chooses to render it).
>
> Actual: the last line shows <b0> in reverse video.
>
> I haven't looked at the code but my guess is that zle assumes that
> characters from Private Use Area never have a native reasonable
> representation, so it attempts to show codepoints. This assumption is
> incorrect. I think Private Use Area characters shouldn't be handled
> specially. If there is no glyph in the terminal's font for a character, let
> the terminal decide how to present that.
>
> Note: Private Use Area characters work fine everywhere else. For example,
> in PS1.

I'm not sure we have any choice, we have to know how wide every
character we print is, and presumably there is no defined width for
them as the characters themselves are not defined.

-- 
Mikael Magnusson




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