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

Re: PATCH: read full multibyte string a bit more sooner

On Sep 12,  9:46am, Bart Schaefer wrote:
} I then switched back to zsh-5.1.1-dev-0 and tried to repeat this.
} The very first time I pasted the test string, I got this: [...]
} As you can see this is ALMOST correct, except for that unexpected
} trailing tilde

So one more tidbit:  I reverted back to the 5.1 version of the
bracketed-paste-magic source with the 5.1.1-dev-0 binary and tried
this again, and with the mbchar+= loop removed (so relying solely
on read-command to read multiple bytes properly), I NEVER get a
correct result, even on first paste -- I always get the <ffffffff>

Which means that read-command is still returning something that
matches [[:INCOMPLETE:]]* on that very first call, which ought to
be impossible as I understand it.  And indeed, if I step across
getrestchar() with a debugger, it's failing on any character that
is more than two bytes wide (returning only the first two bytes),
which probably leaves mbrtowc() in an indeterminate state.  (This
is reading from the "zle -U" buffer so key timeout does not matter.)

Is it possible this is happening because my environment LC_CTYPE
is not set, even though I have LANG=en_US.UTF-8 ?

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