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

Re: command line not refresh properly with wide chars when cursor would have been inside one

On 16 October 2010 13:21, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> zsh -f
> % echo ããã
> % uuuuuu<up>
> % echo ã    [cursor here]
> if you type one more (or less, or three or five more) letters, the
> line refreshes properly, but when it would have ended up in the middle
> of a wide char, the line gets cut off. This has bothered me for quite
> some time but I've never been able to figure out the exact
> circumstances before. Verified in latest cvs and 4.3.6 with -f.

Actually the problem is when the previous line ends in a wide char in
the new line, doesn't matter where the cursor is.

Hmm, it seems the problem is somewhere in refreshline (surprise,
right?). First all the characters of "echo ã" are printed one by one,
but then ol is advanced past the end of the old string "uuuuuu" and
somehow after that are ããã which causes

/* skip past all matching characters */
for (; nl->chr && ZR_equal(*ol, *nl); nl++, ol++, ccs++)

to trigger, which is why the rest of the string isn't output. Why this
happens is a bit of a mystery to me still.

Mikael Magnusson

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