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 --- test/ui/Makefile.am | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/ui/Makefile.am (limited to 'test/ui/Makefile.am') diff --git a/test/ui/Makefile.am b/test/ui/Makefile.am new file mode 100644 index 0000000..19c3637 --- /dev/null +++ b/test/ui/Makefile.am @@ -0,0 +1,35 @@ +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +ui_TESTS = \ + test/ui/console-sequence + +TESTS += $(ui_TESTS) +check_PROGRAMS += $(ui_TESTS) + +test_ui_console_sequence_SOURCES = \ + test/ui/console-sequence.c + +test_ui_console_sequence_CPPFLAGS = \ + -DPETITBOOT_TEST \ + -I$(top_srcdir)/lib + +test_ui_console_sequence_LDFLAGS = \ + $(core_lib) + + + +#$(ui_TESTS): LIBS += \ +# ui/ncurses/libpbnc.la \ +# $(core_lib) \ +# @MENU_LIB@ @FORM_LIB@ @CURSES_LIB@ -- cgit v1.2.1