-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for unexpected C0 inside CSI sequence #158
Comments
Have you seen the Paul Flo Williams parser? It might be useful for you. It covers everything except one sequence from VT52 submode (direct cursor position). |
Thanks for the awesome link! This helped a lot in understanding how to deal with control characters like C0 inside sequences. It seems to me that I once saw this document a long time ago, but did not give it due attention. I understand that if you're going to emulate a real terminal, you should match all observable behavior described in this document, but there are several nuances dictated by realities:
In my implementation, the receiving buffer accumulates data until it sees a completed sequence and a valid (not broken codepoint) UTF-8 sequence at the end, and only then passes this data to the parser. In my case, the sequence |
A couple comments:
Glad that doc reference helped. :) I mentioned it because in addition to supporting your own terminal, if you look into others some of them are modeled after that specific parser with very similar state names. It can help having a similar "map" when you are working on bugs for them, or cherry-picking features you'd like for yourself. (Also happy to see @ismail-yilmaz around. He's got a very nice embeddable terminal of his own. :) ) |
For the record, MidnightCommander's input parser does not discard the entire sequence when it receives a minus sign and extra characters appear in the input. I try to only use the minus for those applications that can interpret it correctly (something like DECSET 10060 mode). |
repro:
CSI \r 34 m
orCSI 34 \r m
as\r CSI 34 m
The text was updated successfully, but these errors were encountered: