From 1c9633d669948155455e29b0c6e770995a8b1ca3 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 15 Jun 2014 14:50:00 +0200 Subject: terminal: add parser state-machine The term-parser is used to parse any input from TTY-clients. It reads CSI, DCS, OSC and ST control sequences and normal escape sequences. It doesn't do anything with the parsed data besides detecting the sequence and returning it. The caller has to react to them. The parser also comes with its own UTF-8 helpers. The reason for that is that we don't want to assert() or hard-fail on parsing errors. Instead, we treat any invalid UTF-8 sequences as ISO-8859-1. This allows pasting invalid data into a terminal (which cannot be controlled through the TTY, anyway) and we still deal with it in a proper manner. This is _required_ for 8-bit and 7-bit DEC modes (including the g0-g3 mappings), so it's not just an ugly fallback because we can (it's still horribly ugly but at least we have an excuse). --- .gitignore | 1 + 1 file changed, 1 insertion(+) (limited to '.gitignore') diff --git a/.gitignore b/.gitignore index 0ba01daebb..288cde6700 100644 --- a/.gitignore +++ b/.gitignore @@ -220,6 +220,7 @@ /test-strxcpyx /test-tables /test-term-page +/test-term-parser /test-time /test-tmpfiles /test-udev -- cgit v1.2.3-54-g00ecf