Repository: microsoft/terminal (language: cpp)

Issue:
[1.17] Crash with Voice Access launch
### Windows Terminal version

commit da2b80bc0

### Windows build number

10.0.25262.0

### Other Software

_No response_

### Steps to reproduce

1. Open WT Dev build
2. Open voice access (must have been closed)
3. Crash!

### Expected Behavior

No crash

### Actual Behavior

Crash here:
https://github.com/microsoft/terminal/blob/da2b80bc0a38f5df49a4b987527decb302d16b7b/src/cascadia/WindowsTerminal/IslandWindow.cpp#L663




Discussion / hints:

Fix patch:
diff --git a/src/cascadia/WindowsTerminal/IslandWindow.cpp b/src/cascadia/WindowsTerminal/IslandWindow.cpp
index 4d76921656c..4ed300f9be1 100644
--- a/src/cascadia/WindowsTerminal/IslandWindow.cpp
+++ b/src/cascadia/WindowsTerminal/IslandWindow.cpp
@@ -660,13 +660,19 @@ long IslandWindow::_calculateTotalSize(const bool isWidth, const long clientSize
     }
     case WM_SETTINGCHANGE:
     {
-        const std::wstring param{ (wchar_t*)lparam };
-        // ImmersiveColorSet seems to be the notification that the OS theme
-        // changed. If that happens, let the app know, so it can hot-reload
-        // themes, color schemes that might depend on the OS theme
-        if (param == L"ImmersiveColorSet")
+        // Currently, we only support checking when the OS theme changes. In
+        // that case, wParam is 0. Re-evaluate when we decide to reload env vars
+        // (GH#1125)
+        if (wparam == 0)
         {
-            _UpdateSettingsRequestedHandlers();
+            const std::wstring param{ (wchar_t*)lparam };
+            // ImmersiveColorSet seems to be the notification that the OS theme
+            // changed. If that happens, let the app know, so it can hot-reload
+            // themes, color schemes that might depend on the OS theme
+            if (param == L"ImmersiveColorSet")
+            {
+                _UpdateSettingsRequestedHandlers();
+            }
         }
         break;
     }


Test patch: