Skip to content

Start separating CSI parsing from parsing of other sequences.

Martin Hostettler requested to merge hostettler/konsole:pr/csi-separation into master

The escape sequence parser in Vt102Emulation is fuzzy in classifying sequences. The commit move it a bit nearer to parsing according to the widely accepted terminal sequence structure by restricting CSI (from ecma-48) parsing rules from rules applicable to non CSI sequences and common parsing rules.

This tightens up parsing of non CSI sequences. Sequences like ESC % = now no longer are misinterpreted as unfinished but as complete sequence which matches how other terminals tokenize and also matches the emca-35 syntax.

This is done by moving most of the parsing rules to branches of an if-statement conditional on the first 2 characters in tokenBuffer.


This was tested manually, using esc test (the konsole specific fork) and using the auto tests.

The parser currently does not have detailed tests, but I think adding those tests should happen in a separate merge request, i hope that i can open a MR with some basic tests for the happy cases soon.

Merge request reports