-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
Environment
Windows build number: Version 10.0.18362.175
Windows Terminal version (if applicable): 0.2.1831.0
Steps to reproduce
- Open a WSL bash shell in the Windows Terminal.
- Use the SCS (Select Character Set) escape sequence to select the Special Graphics character set.
- Output the
_character, which should map to a blank. - Output the
`character, which should map to a diamond. - Note that the
_character doesn't map to a blank, and the`character maps to a double-width diamond which causes subsequent characters to be out of alignment.
Here's an example printf statement that will demonstrate the issue:
printf '\e(0[_]\n[`]\n\e(B'
For reference, the Special Graphics character set is documented here:
https://vt100.net/docs/vt220-rm/table2-4.html
Expected behavior
I'd expect to see output looking something like this:
[ ]
[♦]
Actual behavior
I know this is a minor nit, but it should be an easy fix, and I'd be happy to provide a PR for it. It's just a matter of replacing two characters in the translation table of the TerminalOutput class, and updating the lower bound of the translation range in the TerminalOutput::TranslateKey method.
For the diamond I'd recommend unicode character U+2666 (Black Diamond Suit). Not only does it render as a single width character, but it has better font support, so will typically still work without font fallback.
Also, the pedant in me would just love to tidy up the case of the hex values in that table so they're all consistently lowercase (or whatever you prefer), and fix some of the comments that are incorrect. Assuming it's appropriate to include cleanup like that in the same PR.
