diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 29a0e0f7e..696916c74 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2009-06-03 Corinna Vinschen + + * fhandler_console.cc (fhandler_console::read): Convert Alt-Backspace + to \033\177 or to \377 dependent on the setting of dev_state->metabit. + 2009-06-02 Corinna Vinschen * path.cc (path_conv::check): Don't call set_exec for files on "noacl" 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))