* fhandler.h (fhandler_console::send_winch_maybe): New method.
* fhandler_console.cc (set_console_state_for_spawn): Remove if 0'ed code. (fhandler_console::send_winch_maybe): Define new method. (fhandler_console::read): Use send_winch_maybe where appropriate. (fhandler_console::init): Just call all tcsetattr rather than output_tcsetattr. * select.cc (peek_console): Reorganize so that send_winch_maybe is called for everything but keyboard input.
This commit is contained in:
@@ -661,18 +661,22 @@ peek_console (select_record *me, bool)
|
||||
break;
|
||||
else
|
||||
{
|
||||
if (irec.EventType == WINDOW_BUFFER_SIZE_EVENT)
|
||||
fh->tc->kill_pgrp (SIGWINCH);
|
||||
else if (irec.EventType == MOUSE_EVENT &&
|
||||
(irec.Event.MouseEvent.dwEventFlags == 0 ||
|
||||
irec.Event.MouseEvent.dwEventFlags == DOUBLE_CLICK))
|
||||
if (irec.EventType == KEY_EVENT)
|
||||
{
|
||||
if (fh->mouse_aware ())
|
||||
if (irec.Event.KeyEvent.bKeyDown
|
||||
&& (irec.Event.KeyEvent.uChar.AsciiChar
|
||||
|| get_nonascii_key (irec, tmpbuf)))
|
||||
return me->read_ready = true;
|
||||
}
|
||||
else if (irec.EventType == KEY_EVENT && irec.Event.KeyEvent.bKeyDown == true &&
|
||||
(irec.Event.KeyEvent.uChar.AsciiChar || get_nonascii_key (irec, tmpbuf)))
|
||||
return me->read_ready = true;
|
||||
else
|
||||
{
|
||||
fh->send_winch_maybe ();
|
||||
if (irec.EventType == MOUSE_EVENT
|
||||
&& fh->mouse_aware ()
|
||||
&& (irec.Event.MouseEvent.dwEventFlags == 0
|
||||
|| irec.Event.MouseEvent.dwEventFlags == DOUBLE_CLICK))
|
||||
return me->read_ready = true;
|
||||
}
|
||||
|
||||
/* Read and discard the event */
|
||||
ReadConsoleInput (h, &irec, 1, &events_read);
|
||||
|
Reference in New Issue
Block a user