Skip to content

Some DEC Special Graphics characters aren't quite right #2049

@j4james

Description

@j4james

Environment

Windows build number: Version 10.0.18362.175
Windows Terminal version (if applicable): 0.2.1831.0

Steps to reproduce

  1. Open a WSL bash shell in the Windows Terminal.
  2. Use the SCS (Select Character Set) escape sequence to select the Special Graphics character set.
  3. Output the _ character, which should map to a blank.
  4. Output the ` character, which should map to a diamond.
  5. 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

image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-FontsRelated to the fontArea-RenderingText rendering, emoji, complex glyph & font-fallback issuesArea-VTVirtual Terminal sequence supportIssue-BugIt either shouldn't be doing this or needs an investigation.Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meetingProduct-ConhostFor issues in the Console codebaseResolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions