]> granicus.if.org Git - nethack/commitdiff
curses moving left with ^H
authorPatR <rankin@nethack.org>
Sat, 6 Jul 2019 23:41:04 +0000 (16:41 -0700)
committerPatR <rankin@nethack.org>
Sat, 6 Jul 2019 23:41:04 +0000 (16:41 -0700)
Typing ^H actually passed a 16-bit value back to the core which got
interpreted as ^G after the extra bits were discarded.  I don't think
any previous changes to the curses interface caused this.  It's
astonishing that no one ever noticed; the world must be full of numpad
users.

doc/fixes36.3
win/curses/cursmesg.c
win/curses/cursmisc.c

index 52aa675e40d662adb6e5d04f5ea6afa99f408b5b..e9dd29e5f7f22a9b9a7fe1a4215708ca6bbbebfe 100644 (file)
@@ -1,4 +1,4 @@
-$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.84 $ $NHDT-Date: 1562203850 2019/07/04 01:30:50 $
+$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.85 $ $NHDT-Date: 1562456458 2019/07/06 23:40:58 $
 
 This fixes36.3 file is here to capture information about updates in the 3.6.x
 lineage following the release of 3.6.2 in May 2019. Please note, however,
@@ -169,6 +169,7 @@ curses: when map window was clipped, the 'scrollbars' shown to indicate which
        the 2nd and 3rd fifths (for example) were currently within view
 curses: support users's setting for erase char and kill char when getting a
        line of input with 'popup_dialog' Off (already supported for popup On)
+curses: attempting to use ^H to rush left actually executed ^G (#wizgenesis)
 curses+'perm_invent': entries were wrapping without any control; usually not
        noticeable because next entry overwrote, but visible for final entry
        when whole inventory fit within the available height; looked ok with
index 7c83ac423fa72aa3d03ed57cd6ec67fa4ac38526..dfca0939724aa402c66c96b79c12028a2a9143e3 100644 (file)
@@ -661,7 +661,7 @@ curses_message_win_getline(const char *prompt, char *answer, int buffer)
             goto alldone;
         case '\177': /* DEL/Rubout */
         case KEY_DC: /* delete-character */
-        case '\b': /* ^H (Backspace: '\011') */
+        case '\b': /* ^H (Backspace: '\010') */
         case KEY_BACKSPACE:
             if (len < 1) {
                 len = 1;
index 5dcbe6d920d176095e4ea9b1d325cf7911a5b6ce..4ac85c0a3367ad2f59bc717b699adbf000c17e05 100644 (file)
@@ -792,6 +792,13 @@ curses_convert_keys(int key)
 
     /* Handle arrow keys */
     switch (key) {
+    case KEY_BACKSPACE:
+        /* we can't distinguish between a separate backspace key and
+           explicit Ctrl+H intended to rush to the left; without this,
+           a value for ^H greater than 255 is passed back to core's
+           readchar() and stripping the value down to 0..255 yields ^G! */
+        ret = C('H');
+        break;
     case KEY_LEFT:
         if (iflags.num_pad) {
             ret = '4';