[PR #14498] Don't reload the UI when the keyboard layout changes #30129

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

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

State: closed
Merged: No


Alrighty, this is a silly solution to the problem. Go read #11522.

What if, we just didn't reload the UI for a settings reload?

Terminal refreshes the appearance of panes, profiles, tabs, etc, in TerminalPage::_RefreshUIForSettingsReload. That's only called in TerminalPage::SetSettings, when we specify that we didn't need to reload the UI. Currently, we only don't reload the UI on an initial load of the settings (that makes sense, there's no UI to "reload" yet.)

So what if we did all of TerminalPage::SetSettings, but without the UI reload? We update the keybindings, the command palette, the current language, but not the actual content of the tabs.

before

11522-test-before

after

11522-test-after

Closes #11522?


A caveat from discussion:

This might have some weird irreproducible bugs in it. Consider

  1. Open two terminal windows
  2. Install a WSL distro
  3. Switch the KB layout

Both these windows will reload the settings, find that the new settings (& dynamic profile) are different, and will try to write the settings to the disk. One will win? Maybe? Both will probably end up with a full UI refresh, for determining that the settings file changed.

But is this fine anyways? We're pretty sure there's a backlog item for "reload the settings on a distro install" anyways. And the value add of this fix is probably worth more than the very rare new edge case where this still happens.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/14498 **State:** closed **Merged:** No --- Alrighty, this is a silly solution to the problem. Go read #11522. What if, we just didn't reload the UI for a settings reload? Terminal refreshes the appearance of panes, profiles, tabs, etc, in `TerminalPage::_RefreshUIForSettingsReload`. That's only called in `TerminalPage::SetSettings`, when we specify that we _didn't_ need to reload the UI. Currently, we only _don't_ reload the UI on an initial load of the settings (that makes sense, there's no UI to "**re**load" yet.) So what if we did all of `TerminalPage::SetSettings`, but without the UI reload? We update the keybindings, the command palette, the current language, but _not_ the actual content of the tabs. ### before ![11522-test-before](https://user-images.githubusercontent.com/18356694/205965563-1def1a03-2e9f-4487-b125-f940de11da9e.gif) ### after ![11522-test-after](https://user-images.githubusercontent.com/18356694/205965231-2c4f3bd4-455f-4d07-8c87-70ea0a23059e.gif) Closes #11522? <hr> A caveat from discussion: This might have some _weird_ irreproducible bugs in it. Consider 1. Open two terminal windows 2. Install a WSL distro 3. Switch the KB layout Both these windows will reload the settings, find that the new settings (& dynamic profile) are different, and will try to write the settings to the disk. One will win? Maybe? Both will probably end up with a full UI refresh, for determining that the settings file changed. But is this fine anyways? We're pretty sure there's a backlog item for "reload the settings on a distro install" anyways. And the value add of this fix is probably worth more than the very rare new edge case where this still happens.
claunia added the pull-request label 2026-01-31 09:38:48 +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#30129