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>2010-03-30 20:17:34 +0400
committerCorinna Vinschen <corinna@vinschen.de>2010-03-30 20:17:34 +0400
commitca8eb333c943dc88a273cfaf7ee4fe7e307c4b4e (patch)
treeb117df76602b427e3363bc320d614cc377e35caf
parent298cf05c21636531699b7dfd44aa96b6d2e4872a (diff)
2010-03-30 Thomas Wolff <towo@towo.net>
* fhandler.h (class dev_console): Drop vt100_graphics_mode_active. Add flags vt100_graphics_mode_G0, vt100_graphics_mode_G1 and iso_2022_G1. * fhandler_console.cc: Throughout, tune VT100 graphics mode switching to follow ISO 2022 strictly.
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/fhandler_console.cc28
2 files changed, 24 insertions, 12 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 165442ef4..259c156d2 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-30 Thomas Wolff <towo@towo.net>
+
+ * fhandler.h (class dev_console): Drop vt100_graphics_mode_active.
+ Add flags vt100_graphics_mode_G0, vt100_graphics_mode_G1 and
+ iso_2022_G1.
+ * fhandler_console.cc: Throughout, tune VT100 graphics mode switching
+ to follow ISO 2022 strictly.
+
2010-03-30 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (open): Remove call to sig_dispatch_pending.
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 0917b0bab..ed5ee72e0 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -1161,7 +1161,9 @@ static wchar_t __vt100_conv [31] = {
inline
bool fhandler_console::write_console (PWCHAR buf, DWORD len, DWORD& done)
{
- if (dev_state->vt100_graphics_mode_active)
+ if (dev_state->iso_2022_G1
+ ? dev_state->vt100_graphics_mode_G1
+ : dev_state->vt100_graphics_mode_G0)
for (DWORD i = 0; i < len; i ++)
if (buf[i] >= (unsigned char) '`' && buf[i] <= (unsigned char) '~')
buf[i] = __vt100_conv[buf[i] - (unsigned char) '`'];
@@ -1734,11 +1736,11 @@ fhandler_console::write_normal (const unsigned char *src,
int x, y;
switch (base_chars[*found])
{
- case SO:
- dev_state->vt100_graphics_mode_active = true;
+ case SO: /* Shift Out: Invoke G1 character set (ISO 2022) */
+ dev_state->iso_2022_G1 = true;
break;
- case SI:
- dev_state->vt100_graphics_mode_active = false;
+ case SI: /* Shift In: Invoke G0 character set (ISO 2022) */
+ dev_state->iso_2022_G1 = false;
break;
case BEL:
beep ();
@@ -1862,6 +1864,9 @@ fhandler_console::write (const void *vsrc, size_t len)
else if (*src == 'c') /* RIS Full Reset */
{
dev_state->set_default_attr ();
+ dev_state->vt100_graphics_mode_G0 = false;
+ dev_state->vt100_graphics_mode_G1 = false;
+ dev_state->iso_2022_G1 = false;
clear_screen (0, 0, -1, -1);
cursor_set (true, 0, 0);
dev_state->state_ = normal;
@@ -1959,20 +1964,19 @@ fhandler_console::write (const void *vsrc, size_t len)
else
dev_state->state_ = gotarg1;
break;
- case gotparen:
+ case gotparen: /* Designate G0 Character Set (ISO 2022) */
if (*src == '0')
- dev_state->vt100_graphics_mode_active = true;
+ dev_state->vt100_graphics_mode_G0 = true;
else
- dev_state->vt100_graphics_mode_active = false;
+ dev_state->vt100_graphics_mode_G0 = false;
dev_state->state_ = normal;
src++;
break;
- case gotrparen:
- /* This is not strictly needed, ^N/^O can just always be enabled */
+ case gotrparen: /* Designate G1 Character Set (ISO 2022) */
if (*src == '0')
- /*dev_state->vt100_graphics_mode_SOSI_enabled = true*/;
+ dev_state->vt100_graphics_mode_G1 = true;
else
- /*dev_state->vt100_graphics_mode_SOSI_enabled = false*/;
+ dev_state->vt100_graphics_mode_G1 = false;
dev_state->state_ = normal;
src++;
break;