]> granicus.if.org Git - procps-ng/commitdiff
top: fix 'iokey()' flaw preventing proper translations
authorJim Warner <james.warner@comcast.net>
Thu, 7 Jun 2018 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Sat, 9 Jun 2018 11:45:38 +0000 (21:45 +1000)
As it turns out, the very first entry in the 'iokey()'
tinfo_tab was preventing the proper translation of the
simulated PgUp/PgDn keys (ctrl+meta+k/j). Ignoring the
tortured history behind the most recent change to that
entry, this patch restores the previous value and once
again properly translates these particular keystrokes.

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index 0671e301ba3f18d0c53c9962c8be0e763405831a..ef2402b174d6d3c6bfd4eb87b5983cba9ea49670 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -959,7 +959,7 @@ static int iokey (int action) {
       const char *str;
       int key;
    } tinfo_tab[] = {
-      { "\033\n",kbd_ENTER }, { NULL, kbd_UP       }, { NULL, kbd_DOWN     },
+      { "\n", kbd_ENTER    }, { NULL, kbd_UP       }, { NULL, kbd_DOWN     },
       { NULL, kbd_LEFT     }, { NULL, kbd_RIGHT    }, { NULL, kbd_PGUP     },
       { NULL, kbd_PGDN     }, { NULL, kbd_HOME     }, { NULL, kbd_END      },
       { NULL, kbd_BKSP     }, { NULL, kbd_INS      }, { NULL, kbd_DEL      },