From 8d1e4f053574d69aae89af19983c96500b4156a4 Mon Sep 17 00:00:00 2001 From: Samuel Mendoza-Jonas Date: Tue, 31 Oct 2017 10:49:51 +1100 Subject: ui/ncurses: Safely handle lost terminal control commands 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 --- ui/ncurses/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ui/ncurses/Makefile.am') diff --git a/ui/ncurses/Makefile.am b/ui/ncurses/Makefile.am index 40e11b8..3bc5254 100644 --- a/ui/ncurses/Makefile.am +++ b/ui/ncurses/Makefile.am @@ -24,6 +24,8 @@ ui_ncurses_libpbnc_la_SOURCES = \ ui/ncurses/nc-config.c \ ui/ncurses/nc-config.h \ ui/ncurses/nc-config-help.c \ + ui/ncurses/console-codes.c \ + ui/ncurses/console-codes.h \ ui/ncurses/nc-cui.c \ ui/ncurses/nc-cui.h \ ui/ncurses/nc-cui-help.c \ -- cgit v1.2.1