zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: PATCH: read full multibyte string a bit more sooner
Date: Sat, 12 Sep 2015 09:46:05 -0700	[thread overview]
Message-ID: <CAH+w=7YCYM2rhYL3NecAHc22XR5Tnb7JzE7tL_VaeOcqm0uMeA@mail.gmail.com> (raw)
In-Reply-To: <375b5c20-868c-41f6-af3d-297026ddbda5@email.android.com>

On Sat, Sep 12, 2015 at 2:57 AM, Peter Stephenson
<p.w.stephenson@ntlworld.com> wrote:
>
> On 11 Sep 2015 23:42, Bart Schaefer <schaefer@brasslantern.com> wrote:
>>
>> This breaks for me with bracketed-paste-magic when pasting the multibyte
>> strings from Test/D07multibyte, specifically "More metafied characters
>> in prompt expansion" test that has several different languages.

I just reverted to the zsh-5.1.1 tag and tried again, and it breaks
there, too, so this is probably not specific to the patch in 36483.

> I won't have the source or anything more than
> phones or tablets for a week, but it might be
> meta aggro again.

Unfortunately I don't know what that refers to.

> I've a vague memory 'a grave' has one, if you
> want an easy check.

I threw in a { zle -M -- "$PASTED"; zle -R } in the read-command loop
and got the following output (hope it comes through OK with the
mutibyte in email).  Here is the test string I'm pasting:

Ą Пётр Ильич Чайковский 梶浦由記

And the result (5.1.1 without 36483):

burner% ă Ѓутр Ѓлуиу Чайковский 梶浦烴訃
Ą Пётр Ильич Чайковский 梶浦由記

The first line is what got composed by mbchar+=$KEYS and the second
line is what is actually in $PASTED.  As you can see they match for
some but not all characters.

I then switched back to zsh-5.1.1-dev-0 and tried to repeat this.
Here's where things get really interesting.

The very first time I pasted the test string, I got this:

burner% Ą Пётр Ильич Чайковский 梶浦由記~

As you can see this is ALMOST correct, except for that unexpected
trailing tilde, which must be part of the terminal escape for ending
paste-mode?

Sadly the next time I try pasting, I get this:

burner% ă<ffffffff> Ѓ<ffffffff>у<ffffffff>тр
Ѓ<ffffffff>лу<ffffffff>иу<ffffffff> Чайковский
梶浦烴<ffffffff>訃<ffffffff>
Ą Пётр Ильич Чайковский 梶浦由記

(where all those <ffffffff> are highlighted).  So either there's some
memory corruption, or the internal multibyte parsing state is messed
up, or both.

Is there someone who works in a multibyte character set all the time
who can help with figuring out where this is going wrong?  (Insight
into what happened in the first [5.1.1] case would also be
interesting.)


  reply	other threads:[~2015-09-12 16:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-11 20:29 Peter Stephenson
2015-09-11 22:42 ` Bart Schaefer
2015-09-12  9:57   ` Peter Stephenson
2015-09-12 16:46     ` Bart Schaefer [this message]
2015-09-12 17:56       ` Peter Stephenson
2015-09-12 18:02       ` Bart Schaefer
2015-09-12 19:41 Peter Stephenson
2015-09-12 19:49 ` Bart Schaefer
2015-09-12 20:07 Peter Stephenson
2015-09-12 20:35 ` Bart Schaefer
2015-09-12 23:09   ` Bart Schaefer
2015-09-19 19:25     ` Peter Stephenson
2015-09-19 20:49       ` Bart Schaefer

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='CAH+w=7YCYM2rhYL3NecAHc22XR5Tnb7JzE7tL_VaeOcqm0uMeA@mail.gmail.com' \
    --to=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).