Cygwin: console: Add support for FLUSHO and Ctrl-O.
- With this patch, FLUSHO and Ctrl-O (VDISCARD) get working.
This commit is contained in:
parent
9677efcf00
commit
b56a371436
|
@ -259,6 +259,7 @@ fhandler_console::cons_master_thread (handle_set_t *p, tty *ttyp)
|
|||
{
|
||||
ttyp->kill_pgrp (sig);
|
||||
ttyp->output_stopped = false;
|
||||
ti.c_lflag &= ~FLUSHO;
|
||||
/* Discard type ahead input */
|
||||
goto skip_writeback;
|
||||
}
|
||||
|
@ -286,6 +287,13 @@ fhandler_console::cons_master_thread (handle_set_t *p, tty *ttyp)
|
|||
&& c && i >= output_stopped_at)
|
||||
goto restart_output;
|
||||
}
|
||||
if ((ti.c_lflag & ICANON) && (ti.c_lflag & IEXTEN)
|
||||
&& CCEQ (ti.c_cc[VDISCARD], c))
|
||||
{
|
||||
if (input_rec[i].Event.KeyEvent.bKeyDown)
|
||||
ti.c_lflag ^= FLUSHO;
|
||||
processed = true;
|
||||
}
|
||||
break;
|
||||
case WINDOW_BUFFER_SIZE_EVENT:
|
||||
SHORT y = con.dwWinSize.Y;
|
||||
|
@ -3052,6 +3060,9 @@ fhandler_console::write (const void *vsrc, size_t len)
|
|||
if (bg <= bg_eof)
|
||||
return (ssize_t) bg;
|
||||
|
||||
if (get_ttyp ()->ti.c_lflag & FLUSHO)
|
||||
return len; /* Discard write data */
|
||||
|
||||
if (get_ttyp ()->output_stopped && is_nonblocking ())
|
||||
{
|
||||
set_errno (EAGAIN);
|
||||
|
|
Loading…
Reference in New Issue