[PR #18628] Fix two sources of runtime exceptions #31574

Open
opened 2026-01-31 09:48:07 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/18628

State: closed
Merged: Yes


  • _ApplyLanguageSettingChange calls PrimaryLanguageOverride
    (the WinRT API function) and we would call it every time a new
    window is created. Now it's only called on settings load.
  • _RegisterTabEvents would listen for "Content" changes which can
    be null. IVector::Append throws if a null object is given.
    In our case, it's null if the content got erased with nothing.

Additionally, this fixes a bug where we wouldn't call
_ProcessLazySettingsChanges on startup. This is important if the
settings file was changed while Windows Terminal wasn't running.

Lastly, there's a lifetime fix in this PR, which is a one-line change
and I didn't want to make a separate PR for that.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/18628 **State:** closed **Merged:** Yes --- * `_ApplyLanguageSettingChange` calls `PrimaryLanguageOverride` (the WinRT API function) and we would call it every time a new window is created. Now it's only called on settings load. * `_RegisterTabEvents` would listen for "Content" changes which can be null. `IVector::Append` throws if a null object is given. In our case, it's null if the content got erased with nothing. Additionally, this fixes a bug where we wouldn't call `_ProcessLazySettingsChanges` on startup. This is important if the settings file was changed while Windows Terminal wasn't running. Lastly, there's a lifetime fix in this PR, which is a one-line change and I didn't want to make a separate PR for that.
claunia added the pull-request label 2026-01-31 09:48:07 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31574