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

Re: [3.0.5] patch for resize problem



On Oct 24,  7:52pm, Tatsuo Furukawa wrote:
} Subject: [3.0.5] patch for resize problem
}
} Hello zsh developpers.
} 
} I incorporated 3.1.4's resize code into 3.0.5.  And it works well.

Unfortunately, what you did, except for irrelevant details in params.c,
is revert back to the 3.0.4 code.  The semantics in 3.1.4 are unchanged
from 3.0.4, so incorporating 3.1.4 is in this instance a step backwards.

Although I don't entirely like the 3.0.5 behavior, *I've* never had a
problem with eval $(resize) setting LINES and COLUMNS correctly (which
was Clint's original complaint).  It is true that 3.0.5 doesn't respond
to SIGWINCH, but the 3.0.4 behavior has different bugs that the changes
in 3.0.5 were intended to address, and I presume it is an accident that
the 3.0.5 code isn't in 3.1.4.

If Clint is still out there listening:  Does zsh receive a SIGWINCH when
you eval $(resize)?  If so, guess what:  You're probably not getting any
output from $(resize) at all, because of the EINTR bug in readoutput()
for which I posted a patch a few days ago.  Please try applying my patch
from zsh-users/1880 (note that's zsh-USERS, not -workers) and tell us if
resize starts working for you again.

If the EINTR patch works, then

    TRAPWINCH() { eval $(resize) }

should work too.  (It does for me even without the EINTR patch, but then
I never had any problems with resize to begin with.)

If all you care about is having zsh believe SIGWINCH signals, then a much
simpler patch to 3.0.5, which doesn't back out the other bug fixes, is:

Index: Src/utils.c
--- utils.c	Sat May 23 08:53:31 1998
+++ -	Sat Oct 24 11:36:47 1998
@@ -855,9 +855,9 @@
 	usercols = columns > 0;
 
     if (!ioctl(SHTTY, TIOCGWINSZ, (char *)&shttyinfo.winsize)) {
-	if (!userlines)
+	if (!userlines || from == 1)
 	    lines = shttyinfo.winsize.ws_row;
-	if (!usercols)
+	if (!usercols || from == 1)
 	    columns = shttyinfo.winsize.ws_col;
     }
 #endif   /* TIOCGWINSZ */


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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