ladybird/Userland/Libraries/LibVT
Daniel Bertalan be519022c3 LibVT: Implement new ANSI escape sequence parser
This commit replaces the former, hand-written parser with a new one that
can be generated automatically according to a state change diagram.

The new `EscapeSequenceParser` class provides a more ergonomic interface
to dealing with escape sequences. This interface has been inspired by
Alacritty's [vte library](https://github.com/alacritty/vte/).

I tried to avoid changing the application logic inside the `Terminal`
class. While this code has not been thoroughly tested, I can't find
regressions in the basic command line utilities or `vttest`.

`Terminal` now displays nicer debug messages when it encounters an
unknown escape sequence. Defensive programming and bounds checks have
been added where we access parameters, and as a result, we can now
endure 4-5 seconds of `cat /dev/urandom`. :D

We generate EscapeSequenceStateMachine.h when building the in-kernel
LibVT, and we assume that the file is already in place when the userland
library is being built. This will probably cause problems later on, but
I can't find a way to do it nicely.
2021-05-16 11:50:56 +02:00
..
CMakeLists.txt LibVT: Implement new ANSI escape sequence parser 2021-05-16 11:50:56 +02:00
EscapeSequenceParser.cpp LibVT: Implement new ANSI escape sequence parser 2021-05-16 11:50:56 +02:00
EscapeSequenceParser.h LibVT: Implement new ANSI escape sequence parser 2021-05-16 11:50:56 +02:00
Line.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Line.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Position.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Range.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
StateMachine.txt LibVT: Implement new ANSI escape sequence parser 2021-05-16 11:50:56 +02:00
Terminal.cpp LibVT: Implement new ANSI escape sequence parser 2021-05-16 11:50:56 +02:00
Terminal.h LibVT: Implement new ANSI escape sequence parser 2021-05-16 11:50:56 +02:00
TerminalWidget.cpp Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
TerminalWidget.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
XtermColors.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00