Using an Unfocused Appearance resets any runtime palette and cursor changes #16198

Open
opened 2026-01-31 05:00:28 +00:00 by claunia · 1 comment
Owner

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

Windows Terminal version

1.12.3472.0

Windows build number

10.0.19041.1348

Other Software

No response

Steps to reproduce

  1. Open the Settings in Windows Terminal and go to the Profiles Defaults section.
  2. On the Appearance tab, enable the Unfocused Appearance option (you don't need to change any of the properties though).
  3. Open a WSL bash shell.
  4. Change the default background palette to red using an OSC 11 sequence:
    printf "\e]11;rgb:44/00/00\e\\"
  5. Change the cursor shape to a filled box (something other than your default) with a DECSCUSR sequence:
    printf "\e[1 q"
  6. Switch focus to another application and then switch back again.

Expected Behavior

When the focus returns, I'd expect the background color to be red again, and the cursor to be a filled box again.

Actual Behavior

The background color changes back to the original color scheme, and the cursor returns to the original value in the settings.

I'm not sure there is a good way to fix this though. Perhaps we should be saving the active settings when the app loses focus, and then restoring them when it gains focus again, rather than resetting everything? That doesn't handle all edge case, but it's probably better than nothing.

Otherwise I suppose we could say that runtime changes to these settings aren't expected to work if you've configured an Unfocused Appearance. But if we're going to take that approach, then I think we should really be disabling those sequences completely. Having them appear to work, but then get "randomly" reset just seems like a bug.

Originally created by @j4james on GitHub (Dec 18, 2021). ### Windows Terminal version 1.12.3472.0 ### Windows build number 10.0.19041.1348 ### Other Software _No response_ ### Steps to reproduce 1. Open the Settings in Windows Terminal and go to the _Profiles Defaults_ section. 2. On the _Appearance_ tab, enable the _Unfocused Appearance_ option (you don't need to change any of the properties though). 3. Open a WSL bash shell. 4. Change the default background palette to red using an `OSC 11` sequence: `printf "\e]11;rgb:44/00/00\e\\"` 5. Change the cursor shape to a filled box (something other than your default) with a `DECSCUSR` sequence: `printf "\e[1 q"` 6. Switch focus to another application and then switch back again. ### Expected Behavior When the focus returns, I'd expect the background color to be red again, and the cursor to be a filled box again. ### Actual Behavior The background color changes back to the original color scheme, and the cursor returns to the original value in the settings. I'm not sure there is a good way to fix this though. Perhaps we should be saving the active settings when the app loses focus, and then restoring them when it gains focus again, rather than resetting everything? That doesn't handle all edge case, but it's probably better than nothing. Otherwise I suppose we could say that runtime changes to these settings aren't expected to work if you've configured an _Unfocused Appearance_. But if we're going to take that approach, then I think we should really be disabling those sequences completely. Having them appear to work, but then get "randomly" reset just seems like a bug.
claunia added the Issue-BugPriority-3Product-TerminalArea-TerminalControl labels 2026-01-31 05:00:28 +00:00
Author
Owner

@Archomeda commented on GitHub (Oct 4, 2024):

I came across this problem as well in #17997. It resets my background color back to its original color when using this feature.

Also another note: this also occurs when ctrl+tabbing between tabs.

@Archomeda commented on GitHub (Oct 4, 2024): I came across this problem as well in #17997. It resets my background color back to its original color when using this feature. Also another note: this also occurs when ctrl+tabbing between tabs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16198