-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Incorrect rendering for Gorched terminal-based game. #6265
Comments
I had a look at the underlying go library that the game is built on,
Then I ran some of the examples in: /tree/master/_examples -- they all render messed up, or don't work at all. I wonder what it's doing that's so wacky. |
Termbox, the library Termloop builds on, notoriously (at least, they're notorious to me 😄) tries to be clever about interacting with the Windows console instead of using our VT support. I wonder what they're doing. This is probably something "conhost recording" would help with. . . 😄 Thanks for looking at this, @oising! |
This is essentially a duplicate of #4363. The game uses console API calls to write to the screen buffer, and it looks like a lot of the blank areas of the background are actually the zero codepoint. Ideally conpty should be translating those to something like a space or non-breaking space, but it's just passing them through as a null control, which then ends up getting ignored. |
Oh, lordy. I didn't look that closely. I just presumed it was VT all the way ... look what I've become! Close as a dup if you see fit, guys. |
I should mention the colors also don't work (i.e. some elements will be invisible) unless you've used the That said, you can actually run the Linux build in WSL, and that works perfectly (as far as I can tell), because it's then using actual VT sequences. |
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: 92001662 Service-Version: 1.20
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
Another render canary for you, @miniksa: Gorched (scorched earth game, terminal version.) It even has a Windows installer, so I'm guessing it was tested on alacritty or something.
From: https://github.com/zladovan/gorched
It should look like:
But actually looks like (with default options):
When I run with "safe" options,
gorched --low-color --ascii-only
I see:No matter what width I set, I couldn't get it to align. Additionally, it seems there's some persistent glitching after the game is quit (ctrl+c) with margins and wrapping.
The text was updated successfully, but these errors were encountered: