summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_console.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-06-03 11:07:38 +0000
committerCorinna Vinschen <corinna@vinschen.de>2009-06-03 11:07:38 +0000
commitc48a1e46bf75b6bb1b3307fa6bebeede45c57729 (patch)
tree948fcaff6887832d8253c09f797db7ce4c86143d /winsup/cygwin/fhandler_console.cc
parent8992a8e070c61b5a05e259779325cdb964fe5985 (diff)
downloadcygnal-c48a1e46bf75b6bb1b3307fa6bebeede45c57729.tar.gz
cygnal-c48a1e46bf75b6bb1b3307fa6bebeede45c57729.tar.bz2
cygnal-c48a1e46bf75b6bb1b3307fa6bebeede45c57729.zip
* fhandler_console.cc (fhandler_console::read): Convert Alt-Backspace
to \033\177 or to \377 dependent on the setting of dev_state->metabit.
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r--winsup/cygwin/fhandler_console.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index b4f47ea1d..fe9307cfe 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -318,8 +318,11 @@ fhandler_console::read (void *pv, size_t& buflen)
/* Adopt the linux standard of translating the backspace key to DEL
except when ALT is pressed. */
if (input_rec.Event.KeyEvent.wVirtualScanCode == 14)
- toadd = (control_key_state & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED))
- ? "" : "\177";
+ {
+ toadd = (control_key_state & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED))
+ ? (dev_state->metabit ? "\377" : "\033\177") : "\177";
+ nread = strlen (toadd);
+ }
else if (wch == 0
/* arrow/function keys */
|| (input_rec.Event.KeyEvent.dwControlKeyState & ENHANCED_KEY))