The color scheme preview in the settings UI no longer works #16065

Closed
opened 2026-01-31 04:56:32 +00:00 by claunia · 5 comments
Owner

Originally created by @j4james on GitHub (Dec 7, 2021).

Originally assigned to: @zadjii-msft on GitHub.

Windows Terminal version

Commit 094273b995

Windows build number

10.0.19041.1348

Other Software

No response

Steps to reproduce

  1. Open the Settings UI
  2. Navigate to the profile Defaults section.
  3. Select the Appearance tab.
  4. Flip through different Color scheme options while watching the preview window.

Expected Behavior

The preview should update to reflect the selected color scheme.

Actual Behavior

The preview doesn't change.

I did a git bisect of the code, which reported commit 094273b995 as the point at which this stop working. However, I'm wondering if perhaps it's an interaction between those changes and the color table refactoring I was doing in #11602 and #11784.

Originally created by @j4james on GitHub (Dec 7, 2021). Originally assigned to: @zadjii-msft on GitHub. ### Windows Terminal version Commit 094273b995352ff9d80f36279c297488b756df1d ### Windows build number 10.0.19041.1348 ### Other Software _No response_ ### Steps to reproduce 1. Open the Settings UI 2. Navigate to the profile _Defaults_ section. 3. Select the _Appearance_ tab. 4. Flip through different _Color scheme_ options while watching the preview window. ### Expected Behavior The preview should update to reflect the selected color scheme. ### Actual Behavior The preview doesn't change. I did a git bisect of the code, which reported commit 094273b995352ff9d80f36279c297488b756df1d as the point at which this stop working. However, I'm wondering if perhaps it's an interaction between those changes and the color table refactoring I was doing in #11602 and #11784.
Author
Owner

@zadjii-msft commented on GitHub (Dec 7, 2021):

which reported commit 094273b as the point at which this stop working

That would have been my guess as well. If this is all that broke, that's pretty dang impressive. I'll add this to 1.13 to make sure this gets resolved before shipping. Thanks!

@zadjii-msft commented on GitHub (Dec 7, 2021): > which reported commit [094273b](https://github.com/microsoft/terminal/commit/094273b995352ff9d80f36279c297488b756df1d) as the point at which this stop working That would have been my guess as well. If this is all that broke, that's pretty dang impressive. I'll add this to 1.13 to make sure this gets resolved before shipping. Thanks!
Author
Owner

@j4james commented on GitHub (Dec 7, 2021):

FYI, I think this has got something to do with "unfocused appearance". I could "fix" the issue by changing the line below so it always passes in _core.FocusedAppearance():

094273b995/src/cascadia/TerminalControl/TermControl.cpp (L252)

And also changing this call so the parameter hardcoded to true:

094273b995/src/cascadia/TerminalControl/TermControl.cpp (L313)

I'm sure that's not the right solution, but that at least gives you an idea of where things are going wrong. It seems to be attempting to use the unfocused appearance when rendering the preview, and in my case that wasn't actually set to anything.

@j4james commented on GitHub (Dec 7, 2021): FYI, I think this has got something to do with "unfocused appearance". I could "fix" the issue by changing the line below so it always passes in `_core.FocusedAppearance()`: https://github.com/microsoft/terminal/blob/094273b995352ff9d80f36279c297488b756df1d/src/cascadia/TerminalControl/TermControl.cpp#L252 And also changing this call so the parameter hardcoded to `true`: https://github.com/microsoft/terminal/blob/094273b995352ff9d80f36279c297488b756df1d/src/cascadia/TerminalControl/TermControl.cpp#L313 I'm sure that's not the right solution, but that at least gives you an idea of where things are going wrong. It seems to be attempting to use the unfocused appearance when rendering the preview, and in my case that wasn't actually set to anything.
Author
Owner

@j4james commented on GitHub (Dec 7, 2021):

It looks like the problem is that the preview control is created disabled, and with AllowFocusWhenDisabled set to false. Since it can never gain focus, it always renders with the unfocused appearance.

094273b995/src/cascadia/TerminalSettingsEditor/Profiles.cpp (L414-L415)

One possible fix would be to set the _focused property to true by default when TermControl is created, and rely on the control receiving a lost focus event (when not disabled) to change that to false when necessary. The preview control wouldn't receive those events so would always be viewed as focused.

If there are situations where the _focused property has to be false by default, we could always add the initial focus state as a constructor parameter, or maybe add a method to force the focused state.

I don't know much about the UI side of things, though, so maybe it's more complicated than this. Just throwing out some ideas.

@j4james commented on GitHub (Dec 7, 2021): It looks like the problem is that the preview control is created disabled, and with `AllowFocusWhenDisabled` set to false. Since it can never gain focus, it always renders with the unfocused appearance. https://github.com/microsoft/terminal/blob/094273b995352ff9d80f36279c297488b756df1d/src/cascadia/TerminalSettingsEditor/Profiles.cpp#L414-L415 One possible fix would be to set the `_focused` property to true by default when `TermControl` is created, and rely on the control receiving a lost focus event (when not disabled) to change that to false when necessary. The preview control wouldn't receive those events so would always be viewed as focused. If there are situations where the `_focused` property _has_ to be false by default, we could always add the initial focus state as a constructor parameter, or maybe add a method to force the focused state. I don't know much about the UI side of things, though, so maybe it's more complicated than this. Just throwing out some ideas.
Author
Owner

@zadjii-msft commented on GitHub (Jan 5, 2022):

Yea, that all makes sense. Messing with _focused might just give us a fix for #11411 too. The trick there though is making sure when you're opening a bunch of panes at once that only the last one actually gets the blinking cursor.

But now I'm looking at the pair of these so hopefully I can come up with something

@zadjii-msft commented on GitHub (Jan 5, 2022): Yea, that all makes sense. Messing with `_focused` might just give us a fix for #11411 too. The trick there though is making sure when you're opening a bunch of panes at once that only the last one actually gets the blinking cursor. But now I'm looking at the pair of these so hopefully I can come up with something
Author
Owner

@ghost commented on GitHub (Feb 3, 2022):

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

Handy links:

@ghost commented on GitHub (Feb 3, 2022): :tada:This issue was addressed in #12095, which has now been successfully released as `Windows Terminal Preview v1.13.10336.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.13.10336.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?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#16065