Open the Settings in Windows Terminal and go to the Profiles Defaults section.
On the Appearance tab, enable the Unfocused Appearance option (you don't need to change any of the properties though).
Open a WSL bash shell.
Change the default background palette to red using an OSC 11 sequence:
printf "\e]11;rgb:44/00/00\e\\"
Change the cursor shape to a filled box (something other than your default) with a DECSCUSR sequence:
printf "\e[1 q"
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.
Windows Terminal version
1.12.3472.0
Windows build number
10.0.19041.1348
Other Software
No response
Steps to reproduce
OSC 11
sequence:printf "\e]11;rgb:44/00/00\e\\"
DECSCUSR
sequence:printf "\e[1 q"
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.