Make requested console reports work

cf https://cygwin.com/ml/cygwin-patches/2012-q3/msg00019.html

This enables the following ESC sequences:
ESC[c sends primary device attributes
ESC[>c sends secondary device attributes
ESC[6n sends cursor position report

    * fhandler.h (class dev_console): Add console read-ahead buffer.
    (class fhandler_console): Add peek function for it (for select).
    * fhandler_console.cc (fhandler_console::setup): Init buffer.
    (fhandler_console::read): Check console read-aheader buffer.
    (fhandler_console::char_command): Put responses to terminal
    requests (device status and cursor position reports) into
    common console buffer (shared between CONOUT/CONIN)
    instead of fhandler buffer (separated).
    * select.cc (peek_console): Check console read-ahead buffer.
This commit is contained in:
Thomas Wolff
2016-03-16 10:25:16 +01:00
committed by Corinna Vinschen
parent e8e379ff1d
commit 734656818a
3 changed files with 30 additions and 4 deletions

View File

@@ -845,6 +845,12 @@ peek_console (select_record *me, bool)
if (!me->read_selected)
return me->write_ready;
if (fh->get_cons_readahead_valid ())
{
select_printf ("cons_readahead");
return me->read_ready = true;
}
if (fh->get_readahead_valid ())
{
select_printf ("readahead");