diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 520d04560..702cfd5df 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,12 @@ +2010-04-11 Corinna Vinschen + + * fhandler.h (class dev_console): Add backspace_keycode member. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize + backspace_keycode with CERASE. + (fhandler_console::read): Return dev_state->backspace_keycode if the + backspace key is pressed. + (fhandler_console::char_command): Implement DECBKM escape sequence. + 2010-04-10 Christopher Faylor * fhandler_console.cc (fhandler_console::read): Default to sending diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 26a7585d7..cf9d7b9ae 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -924,6 +924,7 @@ class dev_console bool iso_2022_G1; bool alternate_charset_active; bool metabit; + char backspace_keycode; char my_title_buf [TITLESIZE + 1]; diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 1e1f691e9..8aebaccf8 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -118,6 +118,7 @@ fhandler_console::get_tty_stuff (int flags = 0) if (PRIMARYLANGID (LOWORD (GetKeyboardLayout (0))) == LANG_ENGLISH) dev_state->meta_mask |= RIGHT_ALT_PRESSED; dev_state->set_default_attr (); + dev_state->backspace_keycode = CERASE; shared_console_info->tty_min_state.sethwnd ((HWND) INVALID_HANDLE_VALUE); } @@ -374,10 +375,9 @@ fhandler_console::read (void *pv, size_t& buflen) if (control_key_state & LEFT_ALT_PRESSED) dev_state->nModifiers |= 8; - /* Send the VERASE character from the terminal settings as backspace keycode. */ if (input_rec.Event.KeyEvent.wVirtualScanCode == 14) { - char c = ti.c_cc[VERASE] ?: CERASE; + char c = dev_state->backspace_keycode; nread = 0; if (control_key_state & ALT_PRESSED) { if (dev_state->metabit) @@ -1398,6 +1398,10 @@ fhandler_console::char_command (char c) } break; + case 67: /* DECBKM ("DEC Backarrow Key Mode") */ + dev_state->backspace_keycode = (c == 'h' ? CTRL('H') : CERASE); + break; + case 1000: /* Mouse tracking */ dev_state->use_mouse = (c == 'h') ? 1 : 0; syscall_printf ("mouse support set to mode %d", dev_state->use_mouse);