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

Open
opened 2026-01-31 08:07:28 +00:00 by claunia · 3 comments
Owner

Originally created by @ClaireCJS on GitHub (Sep 9, 2024).

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 😂

Originally created by @ClaireCJS on GitHub (Sep 9, 2024). ### 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](https://github.com/user-attachments/assets/af4880b4-2900-4469-85fa-83a28dc38fd9) ### Expected Behavior A properly-aligned table ### Actual Behavior This [see image]: ![image](https://github.com/user-attachments/assets/3857b26c-3cfc-44fa-960d-791336eeceda) It was possible to fix the alignment with ```sed```: ![image](https://github.com/user-attachments/assets/b6561f08-04c6-4dd4-a6cd-c827b1dd241a) ...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](https://github.com/user-attachments/assets/c0b22907-6162-4d39-bbc1-f771f75c09ab) If this chart would align properly, I'd have never fallen into the ```sed``` {and ```perl```} holes in trying to fix this 😂
claunia added the Product-ColortoolIssue-BugArea-UserInterface labels 2026-01-31 08:07:28 +00:00
Author
Owner

@ClaireCJS commented on GitHub (Sep 9, 2024):

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

@ClaireCJS commented on GitHub (Sep 9, 2024): I found a patch for my situation! It's definitely tab-related. I ``echo``ed 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](https://github.com/user-attachments/assets/ded34e06-9455-43cc-9113-8ba1eab8e701)
Author
Owner

@j4james commented on GitHub (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.

@j4james commented on GitHub (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.
Author
Owner

@carlos-zamora commented on GitHub (Sep 25, 2024):

We should fix ColorTool to use spaces

@carlos-zamora commented on GitHub (Sep 25, 2024): We should fix ColorTool to use spaces
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22238