summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_console.cc
diff options
context:
space:
mode:
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))