On Tue, Jul 29, 2008 at 02:29:19PM +0200, Corinna Vinschen wrote: >On Jul 29 06:01, Eric Blake wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> According to John Morrison on 7/29/2008 5:56 AM: >> |> At any rate, you've given me an idea. Add this to /etc/profile, and >> |> $LINES and $COLUMNS will be automatically populated for all users, >> |> regardless of whether they use 'shopt -s checkwinsize': >> |> >> |> kill -s WINCH $$ >> | >> | Hi Eric, >> | >> | So, let me get this straight, you _don't_ want/need me to add the shopt >> | but you would like me to add the kill instruction? >> >> Correct, the kill instruction is more efficient than the shopt - there is >> no reason to poll for window changes after every command if the interrupt >> for window changes works. > >I think it doesn't work for console windows. There's no automatic >message when the console window size changes. There is some code >in Cygwin's console code (fhandler_console::send_winch_maybe), but >it only works when a console event is generated. And then it isn't >called on key events. For testing I added the call to the key event >so that the window size change is at least advertised when the next >key is pressed. > >Chris, is there any good reason NOT to call send_winch_maybe on >a key event?
It only makes sense when there is a mouse event. It would make more sense to move the handling of SIGWINCH into the signal handler so that the above works transparently. I'll look into doing that. cgf