Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix conpty rendering of control characters in the buffer (#16825)
When using the legacy console APIs, it's possible to write arbitrary codepoints into the buffer. If any of those codepoints are in the C0 or C1 range, and the buffer contents are forwarded over conpty, they can end up mistakenly interpreted as controls by the connected terminal. This PR fixes that issue by converting any C0 and C1 codepoints in the buffer into printable glyphs before forwarding them over conpty. I've used the C0 glyphs from the DOS 437 codepage and just a `?` for the C1 codepoints, since that's what you would typically have seen in the v1 console with a raster font. Although this doesn't address the main problem in #16410, it should at least fix the rendering issues they're seeing when running their app in Windows Terminal. I've confirmed that the test case in #4363 now looks the same in Windows Terminal as it does in conhost, and I've tested the Windows version of the terminal game [Gorched], and confirmed that it now works correctly in Window Terminal. [Gorched]: https://github.com/zladovan/gorched Closes #4363 Closes #6265 (cherry picked from commit 563b731) Service-Card-Id: 92001661 Service-Version: 1.19
- Loading branch information