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

Re: up-arrow no longer works right



On 2009-03-20 20:31:23 +0000, Peter Stephenson wrote:
> This was a fairly recent change, however.  I'm not sure why the
> tcsettattr() occurs twice, now I look again, but it's not occurring
> twice in Vincent's trace, as it would with the new code.  Older code
> would print the message "bad tcgets", though.
> 
> 2009-03-02  Peter Stephenson  <pws@xxxxxxx>
> 
> 	* Lionel Flandrin: 26625: Src/utils.c: inopportune interrupt
> 	could wreck terminal set up.

Thanks, this seems to fix the problem. Here's the patch modified
for zsh 4.3.9:

--- Src/utils.c.orig	2008-10-31 10:40:18.000000000 +0100
+++ Src/utils.c	2009-03-25 13:55:54.000000000 +0100
@@ -1437,13 +1437,13 @@
 #  ifndef TCSADRAIN
 #   define TCSADRAIN 1	/* XXX Princeton's include files are screwed up */
 #  endif
-	tcsetattr(SHTTY, TCSADRAIN, &ti->tio);
-    /* if (tcsetattr(SHTTY, TCSADRAIN, &ti->tio) == -1) */
+	while (tcsetattr(SHTTY, TCSADRAIN, &ti->tio) == -1 && errno == EINTR)
+	    ;
 # else
-	ioctl(SHTTY, TCSETS, &ti->tio);
-    /* if (ioctl(SHTTY, TCSETS, &ti->tio) == -1) */
+	while (ioctl(SHTTY, TCSETS, &ti->tio) == -1 && errno == EINTR)
+	    ;
 # endif
-	/*	zerr("settyinfo: %e",errno)*/ ;
+	/*	zerr("settyinfo: %e",errno);*/
 #else
 # ifdef HAVE_TERMIO_H
 	ioctl(SHTTY, TCSETA, &ti->tio);

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



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