Open kazatsuyu opened 10 months ago
I am going to delete my fork, so read this(https://github.com/crossterm-rs/crossterm/issues/787). This issue related how to deal with the issue of an illegal bytes into the input. I may not be able to help because I don't have time to spend on crossterm.
https://github.com/tasogare3710/crossterm/tree/fix_handling_of_surrogate_pairs https://github.com/tasogare3710/crossterm/tree/illegal_surrogate_pairs_ppyp
I am going to delete my fork, so read this(#787). This issue related how to deal with the issue of an illegal bytes into the input. I may not be able to help because I don't have time to spend on crossterm.
https://github.com/tasogare3710/crossterm/tree/fix_handling_of_surrogate_pairs https://github.com/tasogare3710/crossterm/tree/illegal_surrogate_pairs_ppyp
I've pushed a backup copy of your branch to https://github.com/joshka/crossterm/tree/illegal_surrogate_pairs_ppyp (this branch contains both commits), and I'll keep it around, so you should be fine to delete your fork whenever you want. Thanks for the heads up.
Resolve #848
Windows Terminal seems to send the characters represented by surrogate pairs in the following order:
On the other hand, crossterm's surrogate pair handling does not distinguish between key-down/key-up events. This may be reasonable, as there are cases where another terminal sends only key-up events, but this results in an incorrect sequence of input from the Windows Terminal.
This fix uses only the last input in the case of a sequence of upper surrogates and ignores the input of lower surrogates with no upper surrogates; in the Windows Terminal, inputs 1 and 4 above are ignored and a single surrogate pair is created from inputs 2 and 3.