Script opened with WT fail when there is space in the path #17970

Closed
opened 2026-01-31 05:59:55 +00:00 by claunia · 3 comments
Owner

Originally created by @VCourdy on GitHub (Jul 19, 2022).

Windows Terminal version

1.14.1862.0

Windows build number

10.0.22000.0

Other Software

Powershell 5.1.22000.653

Steps to reproduce

  1. Set WT as the default terminal (Settings > Startup)
  2. Create a PS1 script in a folder with space
    Write-Host "Bar"
    Pause
    
    Example : foo.ps1 in C:\folder with space
  3. Double click the script
  4. Error :
    "the term "C:\folder" is not recognized as cmdlet function script file or operable program..."

Expected Behavior

Output "Bar"

Actual Behavior

When WT launch a script by double clicking or doing right click / open, the script location is not correctly encapsulated in double quotes.

Originally created by @VCourdy on GitHub (Jul 19, 2022). ### Windows Terminal version 1.14.1862.0 ### Windows build number 10.0.22000.0 ### Other Software Powershell 5.1.22000.653 ### Steps to reproduce 1. Set WT as the default terminal (Settings > Startup) 2. Create a PS1 script in a folder with space ```powershell Write-Host "Bar" Pause ``` Example : foo.ps1 in C:\folder with space 3. Double click the script 4. Error : "the term "C:\folder" is not recognized as cmdlet function script file or operable program..." ### Expected Behavior Output "Bar" ### Actual Behavior When WT launch a script by double clicking or doing right click / open, the script location is not correctly encapsulated in double quotes.
claunia added the Needs-TriageIssue-BugNeeds-Tag-Fix labels 2026-01-31 05:59:55 +00:00
Author
Owner

@DHowett commented on GitHub (Jul 19, 2022):

You cannot typically run a powershell script by double-clicking it. They default to opening in Notepad when you double-click them.
If you have installed something that adds support for double-clicking a PowerShell script, there is a chance that it has been misconfigured or authored improperly.

@DHowett commented on GitHub (Jul 19, 2022): You cannot typically run a powershell script by double-clicking it. They default to opening in Notepad when you double-click them. If you have installed something that adds support for double-clicking a PowerShell script, there is a chance that it has been misconfigured or authored improperly.
Author
Owner

@VCourdy commented on GitHub (Jul 19, 2022):

In fact i simply went in a ps1 file property and set powershell as the default app to use in order to open scripts.
I disabled WT and i have the same issue with powershell so it's not a WT issue.

I'm sorry to have wrongfuly created an issue.

I worked around the issue thanks to this SO :
https://stackoverflow.com/questions/59423051/how-to-run-a-powershell-script-in-a-path-with-spaces

@VCourdy commented on GitHub (Jul 19, 2022): In fact i simply went in a ps1 file property and set powershell as the default app to use in order to open scripts. I disabled WT and i have the same issue with powershell so it's not a WT issue. I'm sorry to have wrongfuly created an issue. I worked around the issue thanks to this SO : https://stackoverflow.com/questions/59423051/how-to-run-a-powershell-script-in-a-path-with-spaces
Author
Owner

@DHowett commented on GitHub (Jul 19, 2022):

I'm sorry to have wrongfuly created an issue.

Oh, that's not a problem at all! It's good for us to know about all of these problems, so we can help people in the future :)
Thank you!

@DHowett commented on GitHub (Jul 19, 2022): > I'm sorry to have wrongfuly created an issue. Oh, that's not a problem at all! It's good for us to know about all of these problems, so we can help people in the future :) Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17970