summaryrefslogtreecommitdiffstats
path: root/ui/ncurses
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2018-07-03 16:34:46 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-07-10 13:46:12 +1000
commit47c55b245aab729a9c23bfb830329022c7b25d83 (patch)
tree95f599575daca6d1731f10a1213dc03cc2d4feb3 /ui/ncurses
parentf3e72665eb06410c6f7e49e030db92349fbbddbf (diff)
downloadtalos-petitboot-47c55b245aab729a9c23bfb830329022c7b25d83.tar.gz
talos-petitboot-47c55b245aab729a9c23bfb830329022c7b25d83.zip
ui/ncurses: Implement non-boot-cancelling keys
Allow some keys to not cancel the default-boot process. For the moment, this is just the screen refresh (ctrl+L). Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'ui/ncurses')
-rw-r--r--ui/ncurses/nc-cui.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c
index 8a3f97d..87540ca 100644
--- a/ui/ncurses/nc-cui.c
+++ b/ui/ncurses/nc-cui.c
@@ -527,6 +527,14 @@ struct nc_scr *cui_set_current(struct cui *cui, struct nc_scr *scr)
return old;
}
+static bool key_cancels_boot(int key)
+{
+ if (key == 0xc)
+ return false;
+
+ return true;
+}
+
static bool process_global_keys(struct cui *cui, int key)
{
switch (key) {
@@ -582,7 +590,7 @@ static int cui_process_key(void *arg)
}
}
- if (!cui->has_input) {
+ if (!cui->has_input && key_cancels_boot(c)) {
cui->has_input = true;
if (cui->client) {
pb_log("UI input received (key = %d), aborting "
OpenPOWER on IntegriCloud