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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14498
Author: @zadjii-msft
Created: 12/6/2022
Status: Closed

Base: mainHead: dev/migrie/b/11522-dumb-idea


📝 Commits (6)

  • 3a472b9 This is a really dumb idea that works better than it has any right to
  • d96e6e8 Merge remote-tracking branch 'origin/main' into dev/migrie/b/11522-dumb-idea
  • 60ace9e Merge remote-tracking branch 'origin/main' into dev/migrie/b/11522-dumb-idea
  • abc62c5 Merge remote-tracking branch 'origin/main' into dev/migrie/b/11522-dumb-idea
  • a0978d0 Merge remote-tracking branch 'origin/main' into dev/migrie/b/11522-dumb-idea
  • e24a116 Merge remote-tracking branch 'origin/main' into dev/migrie/b/11522-dumb-idea

📊 Changes

2 files changed (+15 additions, -19 deletions)

View changed files

📝 src/cascadia/TerminalApp/AppLogic.cpp (+13 -17)
📝 src/cascadia/TerminalApp/AppLogic.h (+2 -2)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/14498 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 12/6/2022 **Status:** ❌ Closed **Base:** `main` ← **Head:** `dev/migrie/b/11522-dumb-idea` --- ### 📝 Commits (6) - [`3a472b9`](https://github.com/microsoft/terminal/commit/3a472b9806bcf6cad16c52debafa5adac8d8de12) This is a really dumb idea that works better than it has any right to - [`d96e6e8`](https://github.com/microsoft/terminal/commit/d96e6e8e45c8d3c34c7a1e6266f4ed96bae1807e) Merge remote-tracking branch 'origin/main' into dev/migrie/b/11522-dumb-idea - [`60ace9e`](https://github.com/microsoft/terminal/commit/60ace9e14b9597f59370dd34e070d851fcff8592) Merge remote-tracking branch 'origin/main' into dev/migrie/b/11522-dumb-idea - [`abc62c5`](https://github.com/microsoft/terminal/commit/abc62c562bb3215c297f4e9e24b5f19b27ac0dda) Merge remote-tracking branch 'origin/main' into dev/migrie/b/11522-dumb-idea - [`a0978d0`](https://github.com/microsoft/terminal/commit/a0978d0022fb1f5b06a8fca408ad3fc7ac048a43) Merge remote-tracking branch 'origin/main' into dev/migrie/b/11522-dumb-idea - [`e24a116`](https://github.com/microsoft/terminal/commit/e24a116dae71352209600d0048fa593aaff6be54) Merge remote-tracking branch 'origin/main' into dev/migrie/b/11522-dumb-idea ### 📊 Changes **2 files changed** (+15 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/AppLogic.cpp` (+13 -17) 📝 `src/cascadia/TerminalApp/AppLogic.h` (+2 -2) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:38:47 +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#30124