summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/select.cc
diff options
context:
space:
mode:
authorThomas Wolff <towo@towo.net>2016-03-16 10:25:16 +0100
committerCorinna Vinschen <corinna@vinschen.de>2016-03-16 10:25:34 +0100
commit734656818aa571c8f0d8d3e73e391c8ae26d79f1 (patch)
treeff21e4c2ddb995fbe187304f9962396f16ee6e7d /winsup/cygwin/select.cc
parente8e379ff1d8c7a018f327f89ff3528213920f56f (diff)
downloadcygnal-734656818aa571c8f0d8d3e73e391c8ae26d79f1.tar.gz
cygnal-734656818aa571c8f0d8d3e73e391c8ae26d79f1.tar.bz2
cygnal-734656818aa571c8f0d8d3e73e391c8ae26d79f1.zip
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.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r--winsup/cygwin/select.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index e1d48a386..1f3276ca2 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -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");