Windows Terminal crashes when changing the system dark/light mode #19399

Closed
opened 2026-01-31 06:42:09 +00:00 by claunia · 4 comments
Owner

Originally created by @j4james on GitHub (Feb 16, 2023).

Windows Terminal version

1.17.1023

Windows build number

10.0.19044.2364

Other Software

No response

Steps to reproduce

  1. Start Windows Terminal
  2. Open the Settings UI
  3. Navigate to the Appearance tab
  4. Set the Theme to "Use Windows theme" and Save
  5. Leave the Settings UI open
  6. Open the Windows settings app
  7. Navigate to the Personalization > Colors section
  8. Switch the color scheme from Dark to Light (or vice versa)

Expected Behavior

Windows Terminal should update to match the system color scheme.

Actual Behavior

Windows Terminal crashes.

When running from within the VS debugger, I get an exception like this:

Unhandled exception at 0x00007FFBBDCEFE32 (KernelBase.dll) in WindowsTerminal.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x0000024A0FCC6090, 0x000000000000000C).

And a stack trace like this:

>	KernelBase.dll!RaiseFailFastException()	Unknown
 	combase.dll!RoFailFastWithErrorContextInternal2(HRESULT hrError, unsigned long cStowedExceptions, _STOWED_EXCEPTION_INFORMATION_V2 * * aStowedExceptionPointers) Line 1455	C++
 	Windows.UI.Xaml.dll!DirectUI::ErrorHelper::ProcessUnhandledError(DirectUI::ErrorInfo & errorInfo, unsigned int fSkipFailFastIfNoErrorContext, unsigned int * pfHandled) Line 616	C++
 	Windows.UI.Xaml.dll!DirectUI::ErrorHelper::ReportUnhandledError(HRESULT hrError) Line 502	C++
 	Windows.UI.Xaml.dll!CXcpDispatcher::Tick() Line 1455	C++
 	Windows.UI.Xaml.dll!CXcpDispatcher::OnReentrancyProtectedWindowMessage(HWND__ * msg, unsigned int lParam, unsigned __int64) Line 1041	C++
 	[Inline Frame] Windows.UI.Xaml.dll!CXcpDispatcher::ProcessMessage(HWND__ *) Line 890	C++
 	Windows.UI.Xaml.dll!CXcpDispatcher::WindowProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 839	C++
 	Windows.UI.Xaml.dll!CDeferredInvoke::DispatchQueuedMessage(bool * dispatchedWork, bool * hasMoreWork) Line 301	C++
 	[Inline Frame] Windows.UI.Xaml.dll!CXcpDispatcher::MessageTimerCallback() Line 1534	C++
 	Windows.UI.Xaml.dll!CXcpDispatcher::MessageTimerCallbackStatic(void * myUserData) Line 1526	C++
 	CoreMessaging.dll!Microsoft__CoreUI__Dispatch__TimeoutHandler$CallbackThunk(class System::Delegate *)	Unknown
 	CoreMessaging.dll!Microsoft::CoreUI::Dispatch::TimeoutManager::Callback_OnDispatch()	Unknown
 	CoreMessaging.dll!Microsoft::CoreUI::Dispatch::EventLoop::Callback_RunCoreLoop(struct Microsoft::CoreUI::Dispatch::RunMode,bool,bool &)	Unknown
 	CoreMessaging.dll!Microsoft::CoreUI::Dispatch::UserAdapter::OnUserDispatch()	Unknown
 	CoreMessaging.dll!Microsoft::CoreUI::Dispatch::UserAdapter_DoWork()	Unknown
 	CoreMessaging.dll!Microsoft::CoreUI::Dispatch::UserAdapter_WindowProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)	Unknown
 	user32.dll!UserCallWinProcCheckWow()	Unknown
 	user32.dll!DispatchClientMessage()	Unknown
 	user32.dll!__fnDWORD()	Unknown
 	ntdll.dll!KiUserCallbackDispatcherContinue()	Unknown
 	win32u.dll!NtUserGetMessage()	Unknown
 	user32.dll!GetMessageW()	Unknown
 	WindowsTerminal.exe!wWinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, wchar_t * __formal, int __formal) Line 149	C++
 	[External Code]	
Originally created by @j4james on GitHub (Feb 16, 2023). ### Windows Terminal version 1.17.1023 ### Windows build number 10.0.19044.2364 ### Other Software _No response_ ### Steps to reproduce 1. Start Windows Terminal 2. Open the Settings UI 3. Navigate to the _Appearance_ tab 4. Set the _Theme_ to "Use Windows theme" and Save 5. Leave the Settings UI open 6. Open the Windows settings app 7. Navigate to the _Personalization_ > _Colors_ section 8. Switch the color scheme from _Dark_ to _Light_ (or vice versa) ### Expected Behavior Windows Terminal should update to match the system color scheme. ### Actual Behavior Windows Terminal crashes. When running from within the VS debugger, I get an exception like this: > Unhandled exception at 0x00007FFBBDCEFE32 (KernelBase.dll) in WindowsTerminal.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x0000024A0FCC6090, 0x000000000000000C). And a stack trace like this: ``` > KernelBase.dll!RaiseFailFastException() Unknown combase.dll!RoFailFastWithErrorContextInternal2(HRESULT hrError, unsigned long cStowedExceptions, _STOWED_EXCEPTION_INFORMATION_V2 * * aStowedExceptionPointers) Line 1455 C++ Windows.UI.Xaml.dll!DirectUI::ErrorHelper::ProcessUnhandledError(DirectUI::ErrorInfo & errorInfo, unsigned int fSkipFailFastIfNoErrorContext, unsigned int * pfHandled) Line 616 C++ Windows.UI.Xaml.dll!DirectUI::ErrorHelper::ReportUnhandledError(HRESULT hrError) Line 502 C++ Windows.UI.Xaml.dll!CXcpDispatcher::Tick() Line 1455 C++ Windows.UI.Xaml.dll!CXcpDispatcher::OnReentrancyProtectedWindowMessage(HWND__ * msg, unsigned int lParam, unsigned __int64) Line 1041 C++ [Inline Frame] Windows.UI.Xaml.dll!CXcpDispatcher::ProcessMessage(HWND__ *) Line 890 C++ Windows.UI.Xaml.dll!CXcpDispatcher::WindowProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 839 C++ Windows.UI.Xaml.dll!CDeferredInvoke::DispatchQueuedMessage(bool * dispatchedWork, bool * hasMoreWork) Line 301 C++ [Inline Frame] Windows.UI.Xaml.dll!CXcpDispatcher::MessageTimerCallback() Line 1534 C++ Windows.UI.Xaml.dll!CXcpDispatcher::MessageTimerCallbackStatic(void * myUserData) Line 1526 C++ CoreMessaging.dll!Microsoft__CoreUI__Dispatch__TimeoutHandler$CallbackThunk(class System::Delegate *) Unknown CoreMessaging.dll!Microsoft::CoreUI::Dispatch::TimeoutManager::Callback_OnDispatch() Unknown CoreMessaging.dll!Microsoft::CoreUI::Dispatch::EventLoop::Callback_RunCoreLoop(struct Microsoft::CoreUI::Dispatch::RunMode,bool,bool &) Unknown CoreMessaging.dll!Microsoft::CoreUI::Dispatch::UserAdapter::OnUserDispatch() Unknown CoreMessaging.dll!Microsoft::CoreUI::Dispatch::UserAdapter_DoWork() Unknown CoreMessaging.dll!Microsoft::CoreUI::Dispatch::UserAdapter_WindowProc(struct HWND__ *,unsigned int,unsigned __int64,__int64) Unknown user32.dll!UserCallWinProcCheckWow() Unknown user32.dll!DispatchClientMessage() Unknown user32.dll!__fnDWORD() Unknown ntdll.dll!KiUserCallbackDispatcherContinue() Unknown win32u.dll!NtUserGetMessage() Unknown user32.dll!GetMessageW() Unknown WindowsTerminal.exe!wWinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, wchar_t * __formal, int __formal) Line 149 C++ [External Code] ```
Author
Owner

@zadjii-msft commented on GitHub (Apr 5, 2023):

Hmmmmmmmmm I can't seem to repro this on main, nor can I on 1.18.833 (which predated the MUX 2.8 changes). Maybe this was a win10-specific bug?

@zadjii-msft commented on GitHub (Apr 5, 2023): Hmmmmmmmmm I can't seem to repro this on `main`, nor can I on 1.18.833 (which predated the MUX 2.8 changes). Maybe this was a win10-specific bug?
Author
Owner

@zadjii-msft commented on GitHub (Apr 5, 2023):

Woah okay yea, on win10, it did blast off into space crash. That's wild!

Other observations:

  • If I don't have the SUI open, we don't crash, but we also don't update the titlebar color. And things that seemingly should update the RequestedTheme (opening tabs, opening About) don't seem to. That's weird.
  • If the SUI is open, even on the main page, then the terminal crashes.
  • Interesting, switching the OS theme another time did cause the Terminal to hang. Loading dump now...
    • Huh, in this stack, the Terminal is hung trying to talk to the monarch to look to see if there's a quake window.
    • Well, that hang I don't think we need to worry about anymore. The monarch hung trying to delete a peasant that died, during the setting update, and then somehow... called back into itself? But we're not doing that in 1.18 anymore.
  • asdf

The fact that this is something that can be fixed by an OS update is... troubling...

@zadjii-msft commented on GitHub (Apr 5, 2023): Woah okay yea, on win10, it did ~blast off into space~ crash. That's wild! Other observations: * ~If I don't have the SUI open, we don't crash, but we also _don't update the titlebar color_. And things that seemingly _should_ update the RequestedTheme (opening tabs, opening About) don't seem to. That's weird.~ * If the SUI is open, even on the main page, then the terminal crashes. * Interesting, switching the OS theme another time did cause the Terminal to hang. Loading dump now... * Huh, in this stack, the Terminal is hung trying to talk to the monarch to look to see if there's a quake window. * Well, that hang I don't think we need to worry about anymore. The monarch hung trying to delete a peasant that died, during the setting update, and then somehow... called back into itself? But we're not doing that in 1.18 anymore. * asdf The fact that this is something that can be fixed by an OS update is... troubling...
Author
Owner

@zadjii-msft commented on GitHub (Apr 5, 2023):

BOY I don't know exactly how or why, but this is fixed in 1.18, even on windows 10. Just installing 1.18.833 on 19044 works like a charm. Probably due to restructuring how we determine if there's a quake window. I know that sounds insane.

@zadjii-msft commented on GitHub (Apr 5, 2023): BOY I don't know exactly how or why, but this is fixed in 1.18, even on windows 10. Just installing 1.18.833 on 19044 works like a charm. Probably due to restructuring how we determine if there's a quake window. I know that sounds insane.
Author
Owner

@j4james commented on GitHub (Apr 5, 2023):

Can confirm that it's working for me now in the dev build. Thanks.

@j4james commented on GitHub (Apr 5, 2023): Can confirm that it's working for me now in the dev build. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19399