zsh-workers
 help / color / mirror / code / Atom feed
* UTF-8/unicode/widechar refresh bug
@ 2007-12-22  5:03 Mikael Magnusson
  2008-01-03 17:17 ` Peter Stephenson
  2008-01-05 13:10 ` Peter Stephenson
  0 siblings, 2 replies; 4+ messages in thread
From: Mikael Magnusson @ 2007-12-22  5:03 UTC (permalink / raw)
  To: zsh-workers

So this happens to me very rarely, but this time I think I've got it
narrowed down. I'm cautiously optimistic someone else will reproduce
it.

zsh -f
bindkey '^E' reset-prompt #or whatever key you want
: aaaaa(enter some characters so the cursor just wraps)〜aaaaaaaa<ctrl-e>

at this point everything after the character that probably gets
garbled in the mail disappears. The unicode codepoint is 301c, a
command to print one for copy-paste or kill-yank is:
echo +MBw|iconv -f UTF-7 -t UTF-8
though it does seem to happen with any arbitrary double-width
character (I tried 4 different ones anyway).

(version is 4.3.4-dev-3, latest cvs)

-- 
Mikael Magnusson

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: UTF-8/unicode/widechar refresh bug
  2007-12-22  5:03 UTF-8/unicode/widechar refresh bug Mikael Magnusson
@ 2008-01-03 17:17 ` Peter Stephenson
  2008-01-05 13:10 ` Peter Stephenson
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2008-01-03 17:17 UTC (permalink / raw)
  To: zsh-workers

On Sat, 22 Dec 2007 06:03:57 +0100
"Mikael Magnusson" <mikachu@gmail.com> wrote:
> So this happens to me very rarely, but this time I think I've got it
> narrowed down. I'm cautiously optimistic someone else will reproduce
> it.
> 
> zsh -f
> bindkey '^E' reset-prompt #or whatever key you want
> : aaaaa(enter some characters so the cursor just wraps)〜aaaaaaaa<ctrl-e>
> 
> at this point everything after the character that probably gets
> garbled in the mail disappears.

Yep, I can reproduce that, but goodness knows when I'm going to get a
chance to look at it (count the zsh mail).  Remind me in a few weeks if
I don't.  (We could do with awakening the bug list on Sourceforge but we
would need a volunteer to run it.)

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: UTF-8/unicode/widechar refresh bug
  2007-12-22  5:03 UTF-8/unicode/widechar refresh bug Mikael Magnusson
  2008-01-03 17:17 ` Peter Stephenson
@ 2008-01-05 13:10 ` Peter Stephenson
  2008-01-05 16:08   ` Mikael Magnusson
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 2008-01-05 13:10 UTC (permalink / raw)
  To: zsh-workers

On Sat, 22 Dec 2007 06:03:57 +0100
"Mikael Magnusson" <mikachu@gmail.com> wrote:
> bindkey '^E' reset-prompt #or whatever key you want
> : aaaaa(enter some characters so the cursor just wraps)〜aaaaaaaa<ctrl-e>
> 
> at this point everything after the character that probably gets
> garbled in the mail disappears.

This seems to fix the problem.

Index: Src/Zle/zle_refresh.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v
retrieving revision 1.50
diff -u -r1.50 zle_refresh.c
--- Src/Zle/zle_refresh.c	23 Nov 2007 00:19:23 -0000	1.50
+++ Src/Zle/zle_refresh.c	5 Jan 2008 13:09:51 -0000
@@ -1055,6 +1055,18 @@
 	ccs = lpromptw;
     }
 
+#ifdef MULTIBYTE_SUPPORT
+    /*
+     * Realign to a real character after any jiggery pokery at
+     * the start of the line.
+     */
+    while (*nl == WEOF) {
+	nl++, ccs++, vcs++;
+	if (*ol)
+	    ol++;
+    }
+#endif
+
 /* 3: main display loop - write out the buffer using whatever tricks we can */
 
     for (;;) {

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: UTF-8/unicode/widechar refresh bug
  2008-01-05 13:10 ` Peter Stephenson
@ 2008-01-05 16:08   ` Mikael Magnusson
  0 siblings, 0 replies; 4+ messages in thread
From: Mikael Magnusson @ 2008-01-05 16:08 UTC (permalink / raw)
  To: zsh-workers

On 05/01/2008, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> On Sat, 22 Dec 2007 06:03:57 +0100
> "Mikael Magnusson" <mikachu@gmail.com> wrote:
> > bindkey '^E' reset-prompt #or whatever key you want
> > : aaaaa(enter some characters so the cursor just wraps)〜aaaaaaaa<ctrl-e>
> >
> > at this point everything after the character that probably gets
> > garbled in the mail disappears.
>
> This seems to fix the problem.

Indeed. I'll let you know if it should happen again. Thanks! (please
ignore any reports in the next few days since I usually leave
terminals open for a long time :)

-- 
Mikael Magnusson

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-05 16:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-22  5:03 UTF-8/unicode/widechar refresh bug Mikael Magnusson
2008-01-03 17:17 ` Peter Stephenson
2008-01-05 13:10 ` Peter Stephenson
2008-01-05 16:08   ` Mikael Magnusson

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).