Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: UNICODE Private Use Area characters in BUFFER
- X-seq: zsh-workers 50834
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Mikael Magnusson <mikachu@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: UNICODE Private Use Area characters in BUFFER
- Date: Mon, 24 Oct 2022 12:50:14 +0200
- Archived-at: <https://zsh.org/workers/50834>
- In-reply-to: <CAH+w=7Zuq5A1QVKiLH-wOCRoU_zrxTMuCXjWH50OYj9Jp6a=Rw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAN=4vMowyKmrQtQb=QTxiVzQJXRubz-o2T12=6aQBHSpkKwOig@mail.gmail.com> <CAHYJk3SWfX7ZaFA=WgDBtSPZD0isV5OUHWgf3ienhzhzK+9xQw@mail.gmail.com> <CAN=4vMoLQBt8ST7E3EachnLra05ENPOiY0nDOC0Z_=a=8Mg4SA@mail.gmail.com> <CAHYJk3Qi+DEGBYZvwXrqehzjbHHunnVfx6dhJB7hJpjM9GWHiQ@mail.gmail.com> <CAN=4vMo1m5O4M72qqpQfu3hC4-FkW0PN4o_eVt_O=-yL0Qx8Sg@mail.gmail.com> <CAH+w=7YCtLoqhx-WmGUKxCCbkGX_5Z1jfGmcd8-59b-iptjOew@mail.gmail.com> <CAH+w=7bJxkKxB2jL0jqxdg0-eeb16u1MCcHnMndT9aDdBDwMpw@mail.gmail.com> <CAHYJk3S0UcuaHZJfHE30p7KMoYw0Y71YS-Mx2WaaJx0Fcjck_Q@mail.gmail.com> <CAH+w=7Zuq5A1QVKiLH-wOCRoU_zrxTMuCXjWH50OYj9Jp6a=Rw@mail.gmail.com>
On Mon, Oct 24, 2022 at 3:44 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sun, Oct 23, 2022 at 6:27 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> >
> > I think if we should do anything with wcwidth9.h, it's remove it.
>
> I must be missing something. If glibc already supports unicode9, then
> isn't the right thing just for Roman to NOT --enable-unicode9?
The behavior w.r.t. Prive Use Area characters in BUFFER is the same
whether or not --enable-unicode9 is used. In other words, iswprint()
returns false.
On Mon, Oct 24, 2022 at 1:36 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sun, Oct 23, 2022 at 4:22 PM Roman Perepelitsa
> <roman.perepelitsa@xxxxxxxxx> wrote:
> >
> > This code shows how zsh treats characters from Private Use Area. The
> > output doesn't depend on or require a terminal. I wanted to show that
> > zsh handles characters from Private Use Area just fine. The only place
> > I know of where zsh cannot handle them is BUFFER.
>
> That's sort of the point? BUFFER does depend on and require a
> terminal. Asserting that zsh "handles" those characters in other
> contexts isn't indicative of anything beyond demonstrating that
> terminal "handling" is a special case.
The fact that Private Use Area characters work in PS1 is informative
here, as is the expansion of ${(m)#foo}. In both contexts zsh assumes
that Private Use Area characters occupy one column.
I went ahead and checked how other shells behave if you paste U+E0B0
into the command line. They all output the character as-is. Shells
that need to keep track of the cursor position all assume that U+E0B0
is narrow. The shells I tried are: bash, csh, mksh, ash and dash.
There is one thing I didn't mention that is relevant. There is at
least one terminal (iTerm2) that has an option to treat Private Use
Area characters as wide. This option is off by default.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author