[host] Changing a color table value above 16 does not update the color of other cells with that index #1624

Closed
opened 2026-01-30 22:32:19 +00:00 by claunia · 4 comments
Owner

Originally created by @zadjii-msft on GitHub (Jun 12, 2019).

From MSFT:20105972

in bash:
printf "\033[38;5;130mHello World"
printf "\033]4;130;rgb:ff/ff/00\07"

The first "Hello World" should appear in a brownish color. Then, after executing the second command, the value of the [130] entry should be updated to yellow. The hello world text should also be yellow now.

image
image

We could achieve this by allowing for TextColor's to have up to 256 stored in their _index member. I'm not sure we'd need more than that - though LookupColor might be confused by that, so we'd need to maybe add a separate is256Index value to the type enum.

Originally created by @zadjii-msft on GitHub (Jun 12, 2019). From MSFT:20105972 in bash: printf "\033[38;5;130mHello World" printf "\033]4;130;rgb:ff/ff/00\07" The first "Hello World" should appear in a brownish color. Then, after executing the second command, the value of the [130] entry should be updated to yellow. The hello world text should also be yellow now. ![image](https://user-images.githubusercontent.com/18356694/59359880-c82fde80-8cf4-11e9-8c97-eec17fee756e.png) ![image](https://user-images.githubusercontent.com/18356694/59359884-ca923880-8cf4-11e9-9f92-efd12a0b40d3.png) We could achieve this by allowing for TextColor's to have up to 256 stored in their _index member. I'm not sure we'd need more than that - though LookupColor might be confused by that, so we'd need to maybe add a separate is256Index value to the type enum.
claunia added the Product-ConhostResolution-Fix-CommittedIssue-BugArea-VT labels 2026-01-30 22:32:19 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Dec 3, 2019):

@j4james just for the record - I think you have a prototype branch floating around for this bug, from discussion in #3717. I also had a prototype branch for this that didn't end up making the cut of the last Windows release. I'm not really planning on investigating anytime soon, but feel free to poke through and compare.

@zadjii-msft commented on GitHub (Dec 3, 2019): @j4james just for the record - I think you have a prototype branch floating around for this bug, from discussion in #3717. I also had a [prototype branch](https://github.com/microsoft/terminal/tree/dev/migrie/b/1223-change-256-table) for this that didn't end up making the cut of the last Windows release. I'm not really planning on investigating anytime soon, but feel free to poke through and compare.
Author
Owner

@j4james commented on GitHub (Dec 4, 2019):

I was just experimenting, and nuked the code afterwards, but it was very close to your prototype actually. One slight difference was that I didn't want to touch the _ColorTable inside the memcpy area, so just stuck an extra buffer afterwards and let it overflow.

That felt horrible, though, which is one of the reasons I didn't want to keep it. But I also strongly suspect that memcpy comment was bogus and could really be ignored. As far as I can see, the shortcut properties should be initialized via the InitFromStateInfo method, and that clearly handles each field individually.

Anyway, the bottom line is I'm not planning on looking at this anytime soon either. I've got a few other things I'm playing with at the moment that I'd like to try and finish first. But I'll keep it on my todo list for the future, assuming you don't get back to it first.

@j4james commented on GitHub (Dec 4, 2019): I was just experimenting, and nuked the code afterwards, but it was very close to your prototype actually. One slight difference was that I didn't want to touch the `_ColorTable` inside the memcpy area, so just stuck an extra buffer afterwards and let it overflow. That felt horrible, though, which is one of the reasons I didn't want to keep it. But I also strongly suspect that memcpy comment was bogus and could really be ignored. As far as I can see, the shortcut properties should be initialized via the [`InitFromStateInfo`](https://github.com/microsoft/terminal/blob/de9231a88b52808f8ad90868663627bbc5b9fbab/src/host/settings.cpp#L203-L236) method, and that clearly handles each field individually. Anyway, the bottom line is I'm not planning on looking at this anytime soon either. I've got a few other things I'm playing with at the moment that I'd like to try and finish first. But I'll keep it on my todo list for the future, assuming you don't get back to it first.
Author
Owner

@j4james commented on GitHub (Apr 28, 2020):

FYI, I'm looking into this again now. I've been working on a couple of PRs that are steps towards fixing #2661, and I think this conhost color table issue is the last major roadblock.

@j4james commented on GitHub (Apr 28, 2020): FYI, I'm looking into this again now. I've been working on a couple of PRs that are steps towards fixing #2661, and I think this conhost color table issue is the last major roadblock.
Author
Owner

@ghost commented on GitHub (Jun 18, 2020):

:tada:This issue was addressed in #5834, which has now been successfully released as Windows Terminal Preview v1.1.1671.0.🎉

Handy links:

@ghost commented on GitHub (Jun 18, 2020): :tada:This issue was addressed in #5834, which has now been successfully released as `Windows Terminal Preview v1.1.1671.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.1.1671.0) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1624