]> git.ozlabs.org Git - petitboot/commitdiff
ui/ncurses: Safely handle lost terminal control commands v1.6.3
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Mon, 30 Oct 2017 23:49:51 +0000 (10:49 +1100)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 14 Nov 2017 05:33:41 +0000 (16:33 +1100)
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>

No differences found