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

Re: 3.0.5: eval `resize` messes up



On May 19,  9:40am, Clint Olsen wrote:
} Subject: Re: 3.0.5: eval `resize` messes up
}
} On May 19, Bart Schaefer wrote:
} > 
} > OK, next question ... what exactly does it not do, that 3.0.2 does?
} 
} Eval `resize` no longer sets the window to the new size so that programs
} like less etc. etc. use the correct terminal window size.

Ah!  Now we're getting somewhere.  If you look in Src/utils.c at around
lines 875-885 you'll see that setting the window size now happens only
when COLUMNS and LINES actually change (rather than on every settyinfo()
as it did before) and that it's now conditional upon `interact' being
true.  If you're interested in running the debugger, you could check the
value of the `from' parameter in adjustwinsize() and see whether that
`if (interact && ...)' case is executing.

The first thing I'd check, though, is that configure did its job correctly
so that TIOCGWINSZ is actually defined at that point when compiling utils.c.
The code in adjustwinsize() is definitely working for me on Linux; I tried
this experiment:

zagzig[38] foo=$(resize)
( stretch the xterm to be much bigger than it was )
zagzig[39] vi
( verify that vim is using the new terminal size )
zagzig[40] eval $foo
zagzig[41] unset LINES COLUMNS
zagzig[42] vi
( vim is now using the old, smaller terminal size )

With LINES and COLUMNS unset, the only place vim could have read the smaller
terminal size is from the tty driver, so zsh must have reset it at the time
of the `eval $foo'.

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



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