Color Error in Docker on WSL2 #20757

Open
opened 2026-01-31 07:23:15 +00:00 by claunia · 2 comments
Owner

Originally created by @MrJia1997 on GitHub (Nov 3, 2023).

Windows Terminal version

1.18.2822.0

Windows build number

10.0.19045.0

Other Software

Docker Desktop 4.24.1
Zsh 5.9
Python 3.11

Steps to reproduce

Using docker exec -it <container> /usr/local/bin/zsh to attach to the running container.
Using python rich module to test color.

Expected Behavior

Color palette should be full and smooth.

Actual Behavior

img_v3_024r_4db93ba3-c05d-476e-a3ef-573fd895ae8g

Originally created by @MrJia1997 on GitHub (Nov 3, 2023). ### Windows Terminal version 1.18.2822.0 ### Windows build number 10.0.19045.0 ### Other Software Docker Desktop 4.24.1 Zsh 5.9 Python 3.11 ### Steps to reproduce Using `docker exec -it <container> /usr/local/bin/zsh` to attach to the running container. Using python rich module to test color. ### Expected Behavior Color palette should be full and smooth. ### Actual Behavior ![img_v3_024r_4db93ba3-c05d-476e-a3ef-573fd895ae8g](https://github.com/microsoft/terminal/assets/16175763/9973f40e-e502-4c4f-b682-9c7bc744b632)
claunia added the Area-OutputIssue-BugPriority-3Product-Terminal labels 2026-01-31 07:23:15 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Nov 6, 2023):

This looks exactly like what I'd expect if docker was using ReadConsoleOutput to read the attributes of the text buffer manually, instead of using ConPTY to get the raw escape sequences. When an app does that, we've got to "round" the color to the nearest color table entry. I could have swore that we worked with the CExecSvc / dockerd folks to move over to conpty though... maybe they're using ConPTY in xterm mode instead of xterm-256color.

The last email I have on the subject was from 2018 with @jstarks - maybe he's got a better idea than me?

@zadjii-msft commented on GitHub (Nov 6, 2023): This looks exactly like what I'd expect if docker was using ReadConsoleOutput to read the attributes of the text buffer manually, instead of using ConPTY to get the raw escape sequences. When an app does that, we've got to "round" the color to the nearest color table entry. I could have swore that we worked with the CExecSvc / dockerd folks to move over to conpty though... maybe they're using ConPTY in `xterm` mode instead of `xterm-256color`. The last email I have on the subject was from 2018 with @jstarks - maybe he's got a better idea than me?
Author
Owner

@carlos-zamora commented on GitHub (Nov 8, 2023):

Docker for WSL2 does not use conpty. We should repro this and investigate this further.

@carlos-zamora commented on GitHub (Nov 8, 2023): Docker for WSL2 does not use conpty. We should repro this and investigate this further.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20757