From c48a1e46bf75b6bb1b3307fa6bebeede45c57729 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 3 Jun 2009 11:07:38 +0000 Subject: * fhandler_console.cc (fhandler_console::read): Convert Alt-Backspace to \033\177 or to \377 dependent on the setting of dev_state->metabit. --- winsup/cygwin/fhandler_console.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/fhandler_console.cc') 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)) -- cgit v1.2.3