Add a setting to control selection foreground color #4999

Open
opened 2026-01-31 00:02:34 +00:00 by claunia · 9 comments
Owner

Originally created by @zadjii-msft on GitHub (Nov 14, 2019).

This is highly related to #3326/#3471 and #3561.

We've added a setting to control what color we use to highlight text with when it's selected in #3471.

However, that doesn't necessarily fix our contrast ratio problems w.r.t. selection, since the configured color might still not have enough difference from the foreground of the highlighted text.

Conhost had an inverting selection, which didn't have this problem. However, we think that might be Hard to implement in the dx renderer. Adding that to the Terminal is being tracked in #3561.

A selection foreground color
A: might be more feasible to implement
B: is a good configurable setting to add regardless, to enable further personalization of the terminal.

Implementation might still be tricky though, since the Renderer is only ever told about the selection rects after it has drawn the text. Re-drawing the text seems like a bad idea. I'm not sure we'll be able to re-order things in the Renderer safely without also impacting the GDI and other rendering heads. This is hard, but easier than inverting selection.

Originally created by @zadjii-msft on GitHub (Nov 14, 2019). This is highly related to #3326/#3471 and #3561. We've added a setting to control what color we use to highlight text with when it's selected in #3471. However, that doesn't _necessarily_ fix our contrast ratio problems w.r.t. selection, since the configured color might still not have enough difference from the foreground of the highlighted text. Conhost had an inverting selection, which didn't have this problem. However, we think that might be Hard to implement in the dx renderer. Adding that to the Terminal is being tracked in #3561. A selection foreground color A: might be more feasible to implement B: is a good configurable setting to add regardless, to enable further personalization of the terminal. Implementation might still be tricky though, since the Renderer is only ever told about the selection rects _after_ it has drawn the text. Re-drawing the text seems like a bad idea. I'm not sure we'll be able to re-order things in the Renderer safely without also impacting the GDI and other rendering heads. This is hard, but easier than inverting selection.
Author
Owner

@mdtauk commented on GitHub (Nov 14, 2019):

I suggested this in the Selection Background colour issue, so I am all for this.

@mdtauk commented on GitHub (Nov 14, 2019): I suggested this in the Selection Background colour issue, so I am all for this.
Author
Owner

@j4james commented on GitHub (Nov 14, 2019):

Note that both XTerm and VTE support OSC 17 and 19 for settings these colors, so that's something we may also want to support in the future. Not essential, but I thought it worth mentioning now in case it's something you need to take into account in the design.

@j4james commented on GitHub (Nov 14, 2019): Note that both XTerm and VTE support OSC 17 and 19 for settings these colors, so that's something we may also want to support in the future. Not essential, but I thought it worth mentioning now in case it's something you need to take into account in the design.
Author
Owner

@zadjii-msft commented on GitHub (Nov 14, 2019):

@j4james I did not know that. That's definitely good info to have, since I definitely said during the #3471 PR "this doesn't need to be in the terminal core, it's not something that's set by VT" :egg_on_face:

It's not a terrible pain to refactor the existing code to support that. We'll make sure to keep that in mind when coming back to this ☺️

@zadjii-msft commented on GitHub (Nov 14, 2019): @j4james I did _not_ know that. That's definitely good info to have, since I definitely said during the #3471 PR "this doesn't need to be in the terminal core, it's not something that's set by VT" :egg_on_face: It's not a terrible pain to refactor the existing code to support that. We'll make sure to keep that in mind when coming back to this ☺️
Author
Owner

@javierdlg commented on GitHub (Dec 12, 2019):

My team is very interested in this as well! Being able to set the background selection text color fixes half of the problem, and setting the foreground as well would clear up our contrast ration issues.

@javierdlg commented on GitHub (Dec 12, 2019): My team is very interested in this as well! Being able to set the background selection text color fixes half of the problem, and setting the foreground as well would clear up our contrast ration issues.
Author
Owner

@javierdlg commented on GitHub (Dec 13, 2019):

@zadjii-msft, has this issue been slated for a release?

@javierdlg commented on GitHub (Dec 13, 2019): @zadjii-msft, has this issue been slated for a release?
Author
Owner

@DHowett-MSFT commented on GitHub (Dec 13, 2019):

@javierdlg no. when it is slated for a release, the Milestone on the righthand side will change from "Backlog". 😄

@DHowett-MSFT commented on GitHub (Dec 13, 2019): @javierdlg no. when it is slated for a release, the _Milestone_ on the righthand side will change from "Backlog". :smile:
Author
Owner

@rub8n commented on GitHub (Feb 5, 2020):

@DHowett-MSFT not having this setting is impacting our accessibility story (e.g. high contrast themes) and thus our ability to release the VS terminal in the release channel.

Do you have any estimates on when you'll be able to expose this setting?

@rub8n commented on GitHub (Feb 5, 2020): @DHowett-MSFT not having this setting is impacting our accessibility story (e.g. high contrast themes) and thus our ability to release the VS terminal in the release channel. Do you have any estimates on when you'll be able to expose this setting?
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 5, 2020):

This is a significant amount of engineering work (cf. the original post) that I can't commit to before Terminal v1.0. I have, however, marked it Help-Wanted. 😄

@DHowett-MSFT commented on GitHub (Feb 5, 2020): This is a significant amount of engineering work (cf. the original post) that I can't commit to before Terminal v1.0. I have, however, marked it Help-Wanted. :smile:
Author
Owner

@nnathan commented on GitHub (Jan 7, 2024):

Any update on this? It's been a few years, for accessibility reasons would love to be able to change the selection foreground colour.

@nnathan commented on GitHub (Jan 7, 2024): Any update on this? It's been a few years, for accessibility reasons would love to be able to change the selection foreground colour.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4999