zsh-workers
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Mikael Magnusson <mikachu@gmail.com>,
	Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: UNICODE Private Use Area characters in BUFFER
Date: Mon, 24 Oct 2022 12:50:14 +0200	[thread overview]
Message-ID: <CAN=4vMofuuDZDJp6sOp+Tip9itwDf5MZ0EUU8vh3WFbVoMENeg@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7Zuq5A1QVKiLH-wOCRoU_zrxTMuCXjWH50OYj9Jp6a=Rw@mail.gmail.com>

On Mon, Oct 24, 2022 at 3:44 AM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> On Sun, Oct 23, 2022 at 6:27 PM Mikael Magnusson <mikachu@gmail.com> 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@brasslantern.com> wrote:
>
> On Sun, Oct 23, 2022 at 4:22 PM Roman Perepelitsa
> <roman.perepelitsa@gmail.com> 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.


  reply	other threads:[~2022-10-24 10:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-23 10:12 Roman Perepelitsa
2022-10-23 16:29 ` Mikael Magnusson
2022-10-23 16:43   ` Roman Perepelitsa
2022-10-23 17:02     ` Bart Schaefer
2022-10-23 17:29       ` Roman Perepelitsa
2022-10-23 18:30         ` Unicode9 (was Re: UNICODE Private Use Area characters in BUFFER) Bart Schaefer
2022-10-23 19:30           ` Roman Perepelitsa
2022-10-23 21:57           ` Mikael Magnusson
2022-10-23 18:54         ` UNICODE Private Use Area characters in BUFFER Bart Schaefer
2022-10-23 19:26           ` Roman Perepelitsa
2022-11-04  9:55         ` Jun T
2022-10-23 22:42     ` Mikael Magnusson
2022-10-23 23:16       ` Roman Perepelitsa
2022-10-23 23:35         ` Bart Schaefer
2022-10-23 23:46           ` Bart Schaefer
2022-10-24  1:27             ` Mikael Magnusson
2022-10-24  1:43               ` Bart Schaefer
2022-10-24 10:50                 ` Roman Perepelitsa [this message]
2022-11-04 10:31                   ` Jun T
2022-11-04 10:33                     ` Roman Perepelitsa
2022-11-04 11:06                       ` Jun T
2022-11-04 11:09                         ` Roman Perepelitsa
2022-11-04 15:32                           ` Jun T

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN=4vMofuuDZDJp6sOp+Tip9itwDf5MZ0EUU8vh3WFbVoMENeg@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=mikachu@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).