feat: ANSI APC implementation as a new event type + it's parsing implementation #992
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this?
This is an implementation for parsing ANSI APC (Application Program Control) sequences into a new event type. The event type in the
enum Eventis named forApplicationProgramControland holds a string. ANSI APC sequences have the form of:The parsing method is implemented only for the parser-unix submodule as it's used only in the UNIX-sphere (see below).
Why?
The Kitty terminal uses APC sequences to encode status responses for the transfer and display of image data to and by the terminal. Currently there are no other solutions for parsing APC sequences by the
crosstermpackage and such APC sequences sent, e.g by the Kitty terminal, are represented as a sequence of key-presses; see #834.The only possibility for the end-user to parse such APC sequences with the
crosstermpackage is to write an additional parser on top of the producedKeyEventsequence which is not optimal.Discussion