microsoft / microsoft/terminal

ColorTool.exe -c results in a misaligned chart

Open
#17,882 3 comments 0 reactions 0 assignees View on GitHub
Area-UserInterface Issue-Bug Product-Colortool
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### 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 😂

Contributor guide

Open the contributing guide

Research direction

Start at the ColorTool.exe -c command entry point and reproduce the chart on the reported Windows setup, comparing the expected and actual alignment. Done means the color chart is a properly aligned table while retaining its ANSI colors; the issue does not name a source file or test, so locate those from the entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.