From c48a1e46bf75b6bb1b3307fa6bebeede45c57729 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 3 Jun 2009 11:07:38 +0000 Subject: [PATCH] * 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/ChangeLog | 5 +++++ winsup/cygwin/fhandler_console.cc | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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))