summaryrefslogtreecommitdiffstats
path: root/ui/ncurses
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-09-02 13:01:20 +1000
committerJeremy Kerr <jk@ozlabs.org>2013-09-06 13:23:35 +0800
commitd28b706489cfd2c11e281ff3eaeb136ca154a1ee (patch)
treea0c4e170b903c5f9c14efa185782ba5a9df96417 /ui/ncurses
parent5a829b87f9763e42fa4fa0afbb9395f37f922002 (diff)
downloadtalos-petitboot-d28b706489cfd2c11e281ff3eaeb136ca154a1ee.tar.gz
talos-petitboot-d28b706489cfd2c11e281ff3eaeb136ca154a1ee.zip
ui/ncurses: Allow both DEL and ^H to map to backspace
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses')
-rw-r--r--ui/ncurses/nc-scr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/ncurses/nc-scr.c b/ui/ncurses/nc-scr.c
index d2455d4..ff20d63 100644
--- a/ui/ncurses/nc-scr.c
+++ b/ui/ncurses/nc-scr.c
@@ -38,6 +38,14 @@ void nc_start(void)
intrflush(stdscr, FALSE); /* Disable interrupt flush. */
curs_set(0); /* Make cursor invisible */
nodelay(stdscr, TRUE); /* Enable non-blocking getch() */
+
+ /* We may be operating with an incorrect $TERM type; in this case
+ * the keymappings will be slightly broken. We want at least
+ * backspace to work though, so we'll define both DEL and ^H to
+ * map to backspace */
+ define_key("\x7f", KEY_BACKSPACE);
+ define_key("\x08", KEY_BACKSPACE);
+
while (getch() != ERR) /* flush stdin */
(void)0;
}
OpenPOWER on IntegriCloud