[PR #11314] Properly escape constructed wt command-lines #28500

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

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

State: closed
Merged: Yes


Ensures that command-lines constructed to invoke wt are escaped properly.

PR Checklist

Detailed Description of the Pull Request / Additional comments

This was broken in two places - when constructing the command-line in the shell extension and in NewTerminalArgs::ToCommandline().

Both places now invoke a shared method to escape the command-line arguments that require it.

Validation Steps Performed

Added a test and additionally:

  • Invoked the shell extension from D:\Downloads\With;Semicolon.
  • Added a newWindow action to settings.json as below and ensured the new window opened without erroring.
    {
      "command": 
      {
        "action": "newWindow",
        "tabTitle": "\";foo\\"
      },
      "keys": "ctrl+shift+s"
    }
    
**Original Pull Request:** https://github.com/microsoft/terminal/pull/11314 **State:** closed **Merged:** Yes --- Ensures that command-lines constructed to invoke `wt` are escaped properly. ## PR Checklist * [x] Closes #11273 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed ## Detailed Description of the Pull Request / Additional comments This was broken in two places - when constructing the command-line in the shell extension and in `NewTerminalArgs::ToCommandline()`. Both places now invoke a shared method to escape the command-line arguments that require it. ## Validation Steps Performed Added a test and additionally: * Invoked the shell extension from `D:\Downloads\With;Semicolon`. * Added a `newWindow` action to `settings.json` as below and ensured the new window opened without erroring. ```json { "command": { "action": "newWindow", "tabTitle": "\";foo\\" }, "keys": "ctrl+shift+s" } ```
claunia added the pull-request label 2026-01-31 09:28:56 +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#28500