New terminal does not handle theme change event. #1633

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

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

From MSFT:21424988
I have to restart the new terminal to see the effects of changing between light and dark windows theme.
You can see at the attached screenshot that the tabs haven't changed it's colors after I changed from Dark to Light theme. UWP apps are supposed to do that by default.

Originally created by @zadjii-msft on GitHub (Jun 12, 2019). From MSFT:21424988 I have to restart the new terminal to see the effects of changing between light and dark windows theme. You can see at the attached screenshot that the tabs haven't changed it's colors after I changed from Dark to Light theme. UWP apps are supposed to do that by default.
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 12, 2019):

This one is interesting. We could probably tackle it as part of #1125, but maybe we want to keep it separate?

@DHowett-MSFT commented on GitHub (Jun 12, 2019): This one is interesting. We could probably tackle it as part of #1125, but maybe we want to keep it separate?
Author
Owner

@Aarklendoia commented on GitHub (Jun 13, 2019):

The window border as well as the area with the Minimize, Maximize and Close buttons does not take the color of the theme (remains white despite the dark theme).

@Aarklendoia commented on GitHub (Jun 13, 2019): The window border as well as the area with the Minimize, Maximize and Close buttons does not take the color of the theme (remains white despite the dark theme).
Author
Owner

@Aarklendoia commented on GitHub (Jun 13, 2019):

image

@Aarklendoia commented on GitHub (Jun 13, 2019): ![image](https://user-images.githubusercontent.com/1765298/59417205-17464400-8dc7-11e9-80df-c29687f7f076.png)
Author
Owner

@Mercurial commented on GitHub (Jun 22, 2019):

same here , anyone know how to fix this?

@Mercurial commented on GitHub (Jun 22, 2019): same here , anyone know how to fix this?
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 22, 2019):

To be blunt: somebody needs to write the code to do this. If we do it, it will come out whenever we are done. If we don’t, we will get back to it eventually.

@DHowett-MSFT commented on GitHub (Jun 22, 2019): To be blunt: somebody needs to write the code to do this. If we do it, it will come out whenever we are done. If we don’t, we will get back to it eventually.
Author
Owner

@AnuthaDev commented on GitHub (Jun 19, 2020):

@DHowett May I work on it??

@AnuthaDev commented on GitHub (Jun 19, 2020): @DHowett May I work on it??
Author
Owner

@DHowett commented on GitHub (Jun 19, 2020):

@AnuthaDev you certainly may 😄

@DHowett commented on GitHub (Jun 19, 2020): @AnuthaDev you certainly may :smile:
Author
Owner

@StefanScherer commented on GitHub (Jul 31, 2020):

Yes please change the window title according to the dark/light theme in Windows. I also have to close and re-open the terminal to fully switch. The theme itself I change the settings.json at the moment, configuring two themes, one for dark, another for light and let it auto-switch according to Windows theme would be even better.

wt-toggle-theme-title-bar-issue

@StefanScherer commented on GitHub (Jul 31, 2020): Yes please change the window title according to the dark/light theme in Windows. I also have to close and re-open the terminal to fully switch. The theme itself I change the settings.json at the moment, configuring two themes, one for dark, another for light and let it auto-switch according to Windows theme would be even better. ![wt-toggle-theme-title-bar-issue](https://user-images.githubusercontent.com/207759/89029374-99c4f680-d32e-11ea-8cda-cb5b95b98905.gif)
Author
Owner

@mdtauk commented on GitHub (Jul 31, 2020):

Not sure if this is a XAML Island thing, but if you are using Xaml ThemeResources - they should update and refresh as the RequestedTheme changes.

@mdtauk commented on GitHub (Jul 31, 2020): Not sure if this is a XAML Island thing, but if you are using Xaml ThemeResources - they should update and refresh as the RequestedTheme changes.
Author
Owner

@zadjii-msft commented on GitHub (Jul 31, 2020):

This is almost certainly Islands related. I'm not sure what window message is sent when the theme changes, but there almost certainly should be one...

@zadjii-msft commented on GitHub (Jul 31, 2020): This is almost _certainly_ Islands related. I'm not sure what window message is sent when the theme changes, but there almost certainly should be one...
Author
Owner

@AnuthaDev commented on GitHub (Jul 31, 2020):

@zadjii-msft I think it's this one: WM_SETTINGCHANGE

@AnuthaDev commented on GitHub (Jul 31, 2020): @zadjii-msft I think it's this one: WM_SETTINGCHANGE
Author
Owner

@Robinzon100 commented on GitHub (Nov 30, 2020):

Yes please change the window title according to the dark/light theme in Windows. I also have to close and re-open the terminal to fully switch. The theme itself I change the settings.json at the moment, configuring two themes, one for dark, another for light and let it auto-switch according to Windows theme would be even better.

wt-toggle-theme-title-bar-issue

can you share how you did this?

@Robinzon100 commented on GitHub (Nov 30, 2020): > Yes please change the window title according to the dark/light theme in Windows. I also have to close and re-open the terminal to fully switch. The theme itself I change the settings.json at the moment, configuring two themes, one for dark, another for light and let it auto-switch according to Windows theme would be even better. > > ![wt-toggle-theme-title-bar-issue](https://user-images.githubusercontent.com/207759/89029374-99c4f680-d32e-11ea-8cda-cb5b95b98905.gif) can you share how you did this?
Author
Owner

@StefanScherer commented on GitHub (Nov 30, 2020):

@Robinzon100 my theme switching is done in this bash script t, it changes the HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -> SystemUsesLightTheme and AppsUseLightTheme and updates the $WINHOME/AppData/Local/Packages/Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe/LocalState/settings.json

I would prefer to just configure a dark and light theme in the terminal and let it update automatically depending on the system theme setting in the registry.

(Update: fixed the link to my script)

@StefanScherer commented on GitHub (Nov 30, 2020): @Robinzon100 my theme switching is done in this [bash script `t`](https://github.com/StefanScherer/dotfiles/blob/main/bin/t#L13-L37), it changes the `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize` -> `SystemUsesLightTheme` and `AppsUseLightTheme` and updates the `$WINHOME/AppData/Local/Packages/Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe/LocalState/settings.json` I would prefer to just configure a dark and light theme in the terminal and let it update automatically depending on the system theme setting in the registry. (Update: fixed the link to my script)
Author
Owner

@TBBle commented on GitHub (Nov 30, 2020):

I would guess the t command is doing something like

New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 -Type Dword -Force

(but using 1 if the current value is 0) and also JSON-editing settings.json for Terminal to change the theme, which WT will immediately apply when it notices the file change.

Edit: Beat me to it by 30 seconds.

@TBBle commented on GitHub (Nov 30, 2020): I would guess the `t` command is doing something like ``` New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 -Type Dword -Force ``` (but using 1 if the current value is 0) and also JSON-editing settings.json for Terminal to change the theme, which WT will immediately apply when it notices the file change. Edit: Beat me to it by 30 seconds.
Author
Owner

@olegKusov commented on GitHub (Jun 7, 2021):

Hi , is there any update on fix? How can we get theme auto switching and config for default light and default dark themes ?

@olegKusov commented on GitHub (Jun 7, 2021): Hi , is there any update on fix? How can we get theme auto switching and config for default light and default dark themes ?
Author
Owner

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

Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button?
image
That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️

@zadjii-msft commented on GitHub (Jun 7, 2021): Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button? ![image](https://user-images.githubusercontent.com/18356694/91237459-5cbb0c80-e700-11ea-9347-b9b1ec2813b1.png) That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️
Author
Owner

@olegKusov commented on GitHub (Jun 10, 2021):

Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button?
image
That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️

Hi, thanks for feedback. Is there any dificulties? How can we help? Because for me automatic theme switching is now the basic OS feature. Windows starts to look very outdated after MacOS where I use automatic dark theme in terminal. And issue created 3 years ago. Do you need some help?

@olegKusov commented on GitHub (Jun 10, 2021): > Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button? > ![image](https://user-images.githubusercontent.com/18356694/91237459-5cbb0c80-e700-11ea-9347-b9b1ec2813b1.png) > That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️ Hi, thanks for feedback. Is there any dificulties? How can we help? Because for me automatic theme switching is now the basic OS feature. Windows starts to look very outdated after MacOS where I use automatic dark theme in terminal. And issue created 3 years ago. Do you need some help?
Author
Owner

@j4james commented on GitHub (Jun 10, 2021):

Do you need some help?

Given that the issue is labelled "Help Wanted", I think it's safe to assume that's a yes. 😉

If you'd like to help, let the team know that you want to work on the feature, and explain briefly how you intend to implement it. You can find more information in the Contributor's Guide.

@j4james commented on GitHub (Jun 10, 2021): > Do you need some help? Given that the issue is labelled "Help Wanted", I think it's safe to assume that's a yes. 😉 If you'd like to help, let the team know that you want to work on the feature, and explain briefly how you intend to implement it. You can find more information in the [Contributor's Guide](https://github.com/microsoft/terminal/blob/main/CONTRIBUTING.md#contributing-fixes--features).
Author
Owner

@zadjii-msft commented on GitHub (Jun 10, 2021):

Yep, there's no real reason we haven't done this other than simply resourcing. We've only got so many devs, and something like 10,000 issues that have been active since the Terminal was first released 😄

@zadjii-msft commented on GitHub (Jun 10, 2021): Yep, there's no real reason we haven't done this other than simply resourcing. We've only got so many devs, and something like 10,000 issues that have been active since the Terminal was first released 😄
Author
Owner

@JasonWei512 commented on GitHub (Jun 22, 2021):

https://user-images.githubusercontent.com/16899918/122917658-d52a4280-d390-11eb-91b6-5d2dd96942ae.mp4

For some reason Windows Terminal 1.8.1521.0 follows system theme on Windows 11, but not on Windows 10.

@JasonWei512 commented on GitHub (Jun 22, 2021): https://user-images.githubusercontent.com/16899918/122917658-d52a4280-d390-11eb-91b6-5d2dd96942ae.mp4 For some reason Windows Terminal 1.8.1521.0 follows system theme on Windows 11, but not on Windows 10.
Author
Owner

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

Huh, that's totally right, this did seemingly get fixed in Windows 11. That seems to me to imply that there was actually just an OS bug that was the actual root cause for this one. I'm gonna close this one out as external - there's maybe something that we could do to fix this on Windows 10, but the fact that an OS fix remedied this makes me think that would be a futile effort.

@zadjii-msft commented on GitHub (Jan 4, 2022): Huh, that's totally right, this did seemingly get fixed in Windows 11. That seems to me to imply that there was actually just an OS bug that was the actual root cause for this one. I'm gonna close this one out as external - there's _maybe_ something that we could do to fix this on Windows 10, but the fact that an OS fix remedied this makes me think that would be a futile effort.
Author
Owner

@j4james commented on GitHub (Jan 4, 2022):

@zadjii-msft I actually have a fix for this on Windows 10 which is not that complicated. Is it worth submitting a PR, or would you rather just leave it as is?

@j4james commented on GitHub (Jan 4, 2022): @zadjii-msft I actually have a fix for this on Windows 10 which is not that complicated. Is it worth submitting a PR, or would you rather just leave it as is?
Author
Owner

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

@j4james If you have a fix in hand then go for it! I'm maybe being a little aggressive in closing out some of the older things in the backlog.

@zadjii-msft commented on GitHub (Jan 4, 2022): @j4james If you have a fix in hand then go for it! I'm maybe being a little aggressive in closing out some of the older things in the backlog.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1633