Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: UNICODE Private Use Area characters in BUFFER
- X-seq: zsh-workers 50810
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: UNICODE Private Use Area characters in BUFFER
- Date: Sun, 23 Oct 2022 18:29:38 +0200
- Archived-at: <https://zsh.org/workers/50810>
- In-reply-to: <CAN=4vMowyKmrQtQb=QTxiVzQJXRubz-o2T12=6aQBHSpkKwOig@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAN=4vMowyKmrQtQb=QTxiVzQJXRubz-o2T12=6aQBHSpkKwOig@mail.gmail.com>
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