alacritty / vte

Parser for virtual terminal emulators
https://docs.rs/vte/
Apache License 2.0
242 stars 56 forks source link

fix dcs handling, and add a test for it #29

Closed doy closed 4 years ago

doy commented 4 years ago

fixes https://github.com/jwilm/vte/issues/28.

it turns out that there were a couple different issues with dcs parsing, and this should resolve all of them:

the test tests the dcs sequence DECUDK documented in the xterm documentation.

additionally, you can see the difference in the parselog output before this change:

$ perl -E'print "foo\eP0;1|17/ab\x9cbar"' | cargo run -q --example parselog
[print] 'f'
[print] 'o'
[print] 'o'
[hook] params=[0], intermediates=[], ignore=false
[put] 31
[put] 37
[put] 2f
[put] 61
[put] 62
[unhook]
[print] 'b'
[print] 'a'
[print] 'r'

compared to after:

$ perl -E'print "foo\eP0;1|17/ab\x9cbar"' | cargo run -q --example parselog
[print] 'f'
[print] 'o'
[print] 'o'
[hook] params=[0, 1], intermediates=[], ignore=false, char='|'
[put] 31
[put] 37
[put] 2f
[put] 61
[put] 62
[unhook]
[print] 'b'
[print] 'a'
[print] 'r'