summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/console-codes.h
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-10-31 10:49:51 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-11-14 16:33:41 +1100
commit8d1e4f053574d69aae89af19983c96500b4156a4 (patch)
tree190c566638fac6bbcc7964566cbe75e6d05d3fff /ui/ncurses/console-codes.h
parent669083ee9eda63af65d7cfc43968947f09162996 (diff)
downloadtalos-petitboot-8d1e4f053574d69aae89af19983c96500b4156a4.tar.gz
talos-petitboot-8d1e4f053574d69aae89af19983c96500b4156a4.zip
ui/ncurses: Safely handle lost terminal control commandsv1.6.3
Normally terminal control commands are caught and handled before ncurses or Petitboot could see them. However several combinations of broken terminal emulators or console connections can cause these command sequences to be seen by Petitboot, usually resulting in Petitboot exiting due to the ESC character and then the rest printed to the console. Aside from confusing the user this can also cancel autoboot, so it's important we don't let these sequences go unnoticed if possible. In ui/ncurses/console-codes we add a state machine that recognises the syntax of these control/escape sequences and handles the lost characters. We don't try to emulate the functionality of these commands, instead just logging them for reference. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'ui/ncurses/console-codes.h')
-rw-r--r--ui/ncurses/console-codes.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/ncurses/console-codes.h b/ui/ncurses/console-codes.h
new file mode 100644
index 0000000..97c0e52
--- /dev/null
+++ b/ui/ncurses/console-codes.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2017 IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#if !defined(_PB_UI_CONSOLE_CODES)
+#define _PB_UI_CONSOLE_CODES
+
+char *handle_control_sequence(void *ctx, signed char start);
+
+#endif
OpenPOWER on IntegriCloud