Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-01-11 15:04:50 +0400
committerCorinna Vinschen <corinna@vinschen.de>2013-01-11 15:04:50 +0400
commit09707415eb6110268da579fa0641c3a451f138ca (patch)
treee01a321687042ecb833a0d1d82b0fca39f8e6efd /winsup/cygwin
parentab664763f0a91e0fba3f33a615b13fb3322b5d1f (diff)
* fhandler.h (class dev_console): Flag for expanded control sequence.
* fhandler_console.cc (char_command): Supporting cursor style modes.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler.h3
-rw-r--r--winsup/cygwin/fhandler_console.cc47
3 files changed, 52 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 863fb560f..7f40ffe6d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-11 Thomas Wolff <towo@towo.net>
+
+ * fhandler.h (class dev_console): Flag for expanded control sequence.
+ * fhandler_console.cc (char_command): Supporting cursor style modes.
+
2013-01-10 Corinna Vinschen <corinna@vinschen.de>
* path.h (path_conv::fs_type): New method.
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index e2db959e5..3225f8f20 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -1,7 +1,7 @@
/* fhandler.h
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -1246,6 +1246,7 @@ class dev_console
unsigned rarg;
bool saw_question_mark;
bool saw_greater_than_sign;
+ bool saw_space;
bool vt100_graphics_mode_G0;
bool vt100_graphics_mode_G1;
bool iso_2022_G1;
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index faedd8ab4..3e1a424f4 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -1,7 +1,7 @@
/* fhandler_console.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2006, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -1510,6 +1510,31 @@ fhandler_console::char_command (char c)
}
dev_state.set_color (get_output_handle ());
break;
+ case 'q': /* Set cursor style (DECSCUSR) */
+ if (dev_state.saw_space)
+ {
+ CONSOLE_CURSOR_INFO console_cursor_info;
+ GetConsoleCursorInfo (get_output_handle (), & console_cursor_info);
+ switch (dev_state.args_[0])
+ {
+ case 0: /* blinking block */
+ case 1: /* blinking block (default) */
+ case 2: /* steady block */
+ console_cursor_info.dwSize = 100;
+ SetConsoleCursorInfo (get_output_handle (), & console_cursor_info);
+ break;
+ case 3: /* blinking underline */
+ case 4: /* steady underline */
+ console_cursor_info.dwSize = 10; /* or Windows default 25? */
+ SetConsoleCursorInfo (get_output_handle (), & console_cursor_info);
+ break;
+ default: /* use value as percentage */
+ console_cursor_info.dwSize = dev_state.args_[0];
+ SetConsoleCursorInfo (get_output_handle (), & console_cursor_info);
+ break;
+ }
+ }
+ break;
case 'h':
case 'l':
if (!dev_state.saw_question_mark)
@@ -1525,6 +1550,17 @@ fhandler_console::char_command (char c)
}
switch (dev_state.args_[0])
{
+ case 25: /* Show/Hide Cursor (DECTCEM) */
+ {
+ CONSOLE_CURSOR_INFO console_cursor_info;
+ GetConsoleCursorInfo (get_output_handle (), & console_cursor_info);
+ if (c == 'h')
+ console_cursor_info.bVisible = TRUE;
+ else
+ console_cursor_info.bVisible = FALSE;
+ SetConsoleCursorInfo (get_output_handle (), & console_cursor_info);
+ break;
+ }
case 47: /* Save/Restore screen */
if (c == 'h') /* save */
{
@@ -1752,7 +1788,7 @@ fhandler_console::char_command (char c)
__small_sprintf (buf, "\033[%d;%dR", y + 1, x + 1);
puts_readahead (buf);
break;
- default:
+ default:
goto bad_escape;
}
break;
@@ -2026,6 +2062,7 @@ fhandler_console::write (const void *vsrc, size_t len)
dev_state.state_ = gotsquare;
dev_state.saw_question_mark = false;
dev_state.saw_greater_than_sign = false;
+ dev_state.saw_space = false;
for (dev_state.nargs_ = 0; dev_state.nargs_ < MAXARGS; dev_state.nargs_++)
dev_state.args_[dev_state.nargs_] = 0;
dev_state.nargs_ = 0;
@@ -2092,6 +2129,12 @@ fhandler_console::write (const void *vsrc, size_t len)
if (dev_state.nargs_ >= MAXARGS)
dev_state.nargs_--;
}
+ else if (*src == ' ')
+ {
+ src++;
+ dev_state.saw_space = true;
+ dev_state.state_ = gotcommand;
+ }
else
{
dev_state.state_ = gotcommand;