Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2009-12-25 20:38:46 +0300
committerChristopher Faylor <me@cgf.cx>2009-12-25 20:38:46 +0300
commit37520977df49e4833ac14335cd5179b58af69cb9 (patch)
tree6d099d5f43cde66894600c981da6488a783feda9
parent14c622c6e3b3e0c98ba739b731099879115f853a (diff)
* fhandler_console.cc (handler_console::read): Use the tty's VERASE character
as the backspace keycode.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler_console.cc17
2 files changed, 17 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 8a2111bed..f0bf2a8ea 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-25 Andy Koppe <andy.koppe@gmail.com>
+
+ * fhandler_console.cc (handler_console::read): Use the tty's VERASE
+ character as the backspace keycode.
+
2009-12-24 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check): Set fileattr to
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index f5814e80f..6cfbcf638 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -375,13 +375,20 @@ fhandler_console::read (void *pv, size_t& buflen)
if (control_key_state & LEFT_ALT_PRESSED)
dev_state->nModifiers |= 8;
- /* Adopt the linux standard of translating the backspace key to DEL
- except when ALT is pressed. */
+ /* Send the VERASE character from the terminal settings as backspace keycode. */
if (input_rec.Event.KeyEvent.wVirtualScanCode == 14)
{
- toadd = (control_key_state & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED))
- ? (dev_state->metabit ? "\377" : "\033\177") : "\177";
- nread = strlen (toadd);
+ char c = ti.c_cc[VERASE];
+ nread = 0;
+ if (control_key_state & ALT_PRESSED) {
+ if (dev_state->metabit)
+ c |= 0x80;
+ else
+ tmp[nread++] = '\e';
+ }
+ tmp[nread++] = c;
+ tmp[nread] = 0;
+ toadd = tmp;
}
/* Allow Ctrl-Space to emit ^@ */
else if (input_rec.Event.KeyEvent.wVirtualKeyCode == VK_SPACE