[PR #11082] [MERGED] Fix a crash when there aren't any recentCommands yet #28397

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11082
Author: @zadjii-msft
Created: 8/30/2021
Status: Merged
Merged: 8/31/2021
Merged by: @undefined

Base: mainHead: dev/migrie/b/cmdpal-recentCommands-empty


📝 Commits (3)

📊 Changes

1 file changed (+10 additions, -1 deletions)

View changed files

📝 src/cascadia/TerminalApp/CommandPalette.cpp (+10 -1)

📄 Description

The first time you open commandline mode, recentCommands doesn't exist yet. However, we immediately try to read the Size() in a couple places. This'll A/V and we'll crash 😨

The fix is easy - don't try and read the size of the non-existent recentCommands

Found this while playing with #11069
Regressed in #11030
Didn't bother filing an issue for it when I have the fix in hand


🔄 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/11082 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 8/30/2021 **Status:** ✅ Merged **Merged:** 8/31/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/b/cmdpal-recentCommands-empty` --- ### 📝 Commits (3) - [`c31d32a`](https://github.com/microsoft/terminal/commit/c31d32abce48fe2a7571f920e74b323f4f7d2e71) A little bug I found - [`c307065`](https://github.com/microsoft/terminal/commit/c307065aae6c8d2a51e5a46f18ceafcaec8a870e) sple - [`54b0306`](https://github.com/microsoft/terminal/commit/54b03064503c1129944a8548064b32edbb33550f) Update src/cascadia/TerminalApp/CommandPalette.cpp ### 📊 Changes **1 file changed** (+10 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/CommandPalette.cpp` (+10 -1) </details> ### 📄 Description The first time you open commandline mode, `recentCommands` doesn't exist yet. However, we immediately try to read the `Size()` in a couple places. This'll A/V and we'll crash 😨 The fix is easy - don't try and read the size of the non-existent `recentCommands` Found this while playing with #11069 Regressed in #11030 Didn't bother filing an issue for it when I have the fix in hand --- <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:28:16 +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#28397