Windows Terminal crashes when nested command does not have command field #12969

Closed
opened 2026-01-31 03:30:18 +00:00 by claunia · 4 comments
Owner

Originally created by @waf on GitHub (Mar 11, 2021).

Crash happens in the latest release of Windows Terminal 1.6 and Preview 1.7.

Environment

Windows build number: Microsoft Windows NT 10.0.19042.0
Windows Terminal version (if applicable):
  Version: 1.6.10571.0
  Version: 1.7.572.0

Steps to reproduce

  1. Add the following command to the actions array:
{
    "name": "Cause a crash",
    "commands": [
        { "name": "hello" },
        { "name": "world" }
    ]
}
  1. Try to run "Cause a crash" from the Command Palette
  2. Windows Terminal crashes

From some experimentation, the crash is caused by the missing "command" field in the nested commands. While the example JSON above is not real-world, I originally found this when I typo'd the "command" field name, which could also happen to other users.

It might be related to #8422, but it's still happening in the latest release of Windows Terminal (both 1.6 and 1.7 preview).

I've submitted a Feedback Hub reproduction with the exact same title as this GitHub issue, but I wasn't signed in, so it appears I didn't get a hyperlink or ID. Let me know if you'd like me to submit another one (signed in this time).

Originally created by @waf on GitHub (Mar 11, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> Crash happens in the latest release of Windows Terminal 1.6 and Preview 1.7. # Environment ```none Windows build number: Microsoft Windows NT 10.0.19042.0 Windows Terminal version (if applicable): Version: 1.6.10571.0 Version: 1.7.572.0 ``` # Steps to reproduce 1. Add the following command to the `actions` array: ```json { "name": "Cause a crash", "commands": [ { "name": "hello" }, { "name": "world" } ] } ``` 2. Try to run "Cause a crash" from the Command Palette 3. Windows Terminal crashes From some experimentation, the crash is caused by the missing `"command"` field in the nested commands. While the example JSON above is not real-world, I originally found this when I typo'd the `"command"` field name, which could also happen to other users. It might be related to #8422, but it's still happening in the latest release of Windows Terminal (both 1.6 and 1.7 preview). I've submitted a Feedback Hub reproduction with the exact same title as this GitHub issue, but I wasn't signed in, so it appears I didn't get a hyperlink or ID. Let me know if you'd like me to submit another one (signed in this time).
Author
Owner

@zadjii-msft commented on GitHub (Mar 11, 2021):

Welp that's a pretty trivial repro. We'll make sure to add it to test cases so that this doesn't regress in the future. Thanks!

@zadjii-msft commented on GitHub (Mar 11, 2021): Welp that's a pretty trivial repro. We'll make sure to add it to test cases so that this doesn't regress in the future. Thanks!
Author
Owner

@Don-Vito commented on GitHub (Mar 14, 2021):

It doesn't seem related to #8422, as that PR modified only the CmdPal (fixed an underflow there) and here it is a bug in the ShortcutActionDispatch that doesn't verify the parameters.

I will add protection in ShortcutActionDispatch and also improve the parsing of the commands.

@Don-Vito commented on GitHub (Mar 14, 2021): It doesn't seem related to #8422, as that PR modified only the CmdPal (fixed an underflow there) and here it is a bug in the ShortcutActionDispatch that doesn't verify the parameters. I will add protection in `ShortcutActionDispatch` and also improve the parsing of the commands.
Author
Owner

@ghost commented on GitHub (Apr 14, 2021):

:tada:This issue was addressed in #9495, which has now been successfully released as Windows Terminal v1.7.1033.0.🎉

Handy links:

@ghost commented on GitHub (Apr 14, 2021): :tada:This issue was addressed in #9495, which has now been successfully released as `Windows Terminal v1.7.1033.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.7.1033.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Apr 14, 2021):

:tada:This issue was addressed in #9495, which has now been successfully released as Windows Terminal Preview v1.8.1032.0.🎉

Handy links:

@ghost commented on GitHub (Apr 14, 2021): :tada:This issue was addressed in #9495, which has now been successfully released as `Windows Terminal Preview v1.8.1032.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.8.1032.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12969