[PR #13692] [MERGED] Call UpdateJumplist only if the settings changed #29716

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13692
Author: @lhecker
Created: 8/5/2022
Status: Merged
Merged: 8/31/2022
Merged by: @DHowett

Base: mainHead: dev/lhecker/5907-jumplist-caching


📝 Commits (1)

  • ccf550b Call UpdateJumplist only if the settings changed

📊 Changes

10 files changed (+87 additions, -29 deletions)

View changed files

📝 src/cascadia/TerminalApp/AppLogic.cpp (+25 -2)
📝 src/cascadia/TerminalApp/AppLogic.h (+1 -0)
📝 src/cascadia/TerminalSettingsModel/ApplicationState.h (+1 -0)
📝 src/cascadia/TerminalSettingsModel/ApplicationState.idl (+5 -8)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp (+5 -0)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.h (+4 -1)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.idl (+3 -1)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp (+22 -3)
📝 src/cascadia/TerminalSettingsModel/FileUtils.cpp (+17 -10)
📝 src/cascadia/TerminalSettingsModel/FileUtils.h (+4 -4)

📄 Description

This commit stores a hash of the settings.json file in ApplicationState
with which we can detect whether the settings contents actually changed.
Since I only use a small 64-bit hash as opposed to SHA2 for instance,
I'm taking the last write time of the file into account as well.
This allows us to skip calling UpdateJumplist at least the majority of app
launches which hopefully improves launch performance on devices with slower IO.

Part of #5907.

Validation Steps Performed

  • Delete some profiles (see above), save settings, tasks are gone
    FYI For some (...) inexplicable reason, shell task lists are preserved forever
    even if msix applications are uninstalled, etc. So to test whether tasks are
    properly written on first app launch we have to delete some profiles/tasks
    first, otherwise we can't see whether they're actually written later.
  • Now exit Windows Terminal, delete settings.json and relaunch
  • All tasks are back
  • With a debugger, ensure that CascadiaSettings::WriteSettingsToDisk
    generates the same hash that LoadAll reads.

🔄 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/13692 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 8/5/2022 **Status:** ✅ Merged **Merged:** 8/31/2022 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `dev/lhecker/5907-jumplist-caching` --- ### 📝 Commits (1) - [`ccf550b`](https://github.com/microsoft/terminal/commit/ccf550bf5504b6c2483c117b165c44f6fd11f00f) Call UpdateJumplist only if the settings changed ### 📊 Changes **10 files changed** (+87 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/AppLogic.cpp` (+25 -2) 📝 `src/cascadia/TerminalApp/AppLogic.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/ApplicationState.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/ApplicationState.idl` (+5 -8) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp` (+5 -0) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.h` (+4 -1) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.idl` (+3 -1) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp` (+22 -3) 📝 `src/cascadia/TerminalSettingsModel/FileUtils.cpp` (+17 -10) 📝 `src/cascadia/TerminalSettingsModel/FileUtils.h` (+4 -4) </details> ### 📄 Description This commit stores a hash of the `settings.json` file in `ApplicationState` with which we can detect whether the settings contents actually changed. Since I only use a small 64-bit hash as opposed to SHA2 for instance, I'm taking the last write time of the file into account as well. This allows us to skip calling `UpdateJumplist` at least the majority of app launches which hopefully improves launch performance on devices with slower IO. Part of #5907. ## Validation Steps Performed * Delete some profiles (see above), save settings, tasks are gone ✅ FYI For some (...) inexplicable reason, shell task lists are preserved forever even if msix applications are uninstalled, etc. So to test whether tasks are properly written on first app launch we have to delete some profiles/tasks first, otherwise we can't see whether they're actually written later. * Now exit Windows Terminal, delete `settings.json` and relaunch * All tasks are back ✅ * With a debugger, ensure that `CascadiaSettings::WriteSettingsToDisk` generates the same hash that `LoadAll` reads. ✅ --- <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:36:29 +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#29716