Skip to content
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

ColorTool.exe -c results in a misaligned chart #17882

Open
ClaireCJS opened this issue Sep 9, 2024 · 3 comments
Open

ColorTool.exe -c results in a misaligned chart #17882

ClaireCJS opened this issue Sep 9, 2024 · 3 comments
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Colortool This is a problem with the utility application ColorTool for manipulating the console color palette.
Milestone

Comments

@ClaireCJS
Copy link

Windows Terminal version

1.20.11781.0

Windows build number

10.0.19045.4780

Other Software

TCC v31.01.15 x64 command line

Steps to reproduce

Run ColorTool.exe -c to display the color chart

image

Expected Behavior

A properly-aligned table

Actual Behavior

This [see image]:
image

It was possible to fix the alignment with sed:
image

...but not in such a way that preserved the ANSI colors, which is the whole point of displaying this table.

I tried redirecting the output to a file so I could maybe fix it in postprocessing, but ColorTool.exe seems to detect if it is being redirected or piped, and the output has no color!! Perhaps ColorTool uses direct screen writes for changing colors, so they don't appear in a way that can be captured by redirect/pipe.

image

If this chart would align properly, I'd have never fallen into the sed {and perl} holes in trying to fix this 😂

@ClaireCJS ClaireCJS added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Sep 9, 2024
@ClaireCJS
Copy link
Author

I found a patch for my situation!

It's definitely tab-related.

I echoed ANSI code to:

  1. Clear all tab stops (\e[3g)
  2. Move to column 7
  3. Create a tab stop there at column 7 (\eH)

It seems to have temporarily patched the alignment bug:
image

@j4james
Copy link
Collaborator

j4james commented Sep 10, 2024

It looks to me like TCC sets the tab stops to 4 columns by default (or perhaps that's a setting you've chosen yourself), but colortool is using a tab control with the expectation that the tab stops are set to the standard 8 column spacing.

As I mentioned in #16533, you can reset the tabs to the default 8 columns with a DECST8C sequence, but I suspect there's just a setting somewhere in TCC that you need to change if that's really what you want.

Otherwise, if someone is keen enough to do the work, we could always patch colortool to remove that tab dependency, so it works regardless of the user's tab settings.

@carlos-zamora
Copy link
Member

We should fix ColorTool to use spaces

@carlos-zamora carlos-zamora added this to the Backlog milestone Sep 25, 2024
@carlos-zamora carlos-zamora added Product-Colortool This is a problem with the utility application ColorTool for manipulating the console color palette. Area-User Interface Issues pertaining to the user interface of the Console or Terminal and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Colortool This is a problem with the utility application ColorTool for manipulating the console color palette.
Projects
None yet
Development

No branches or pull requests

3 participants