Cannot handle space in file path when using multiple profiles #14720

Closed
opened 2026-01-31 04:17:46 +00:00 by claunia · 14 comments
Owner

Originally created by @jordankittle on GitHub (Jul 28, 2021).

Windows Terminal version (or Windows build number)

10.0.19041.1052

Other Software

No response

Steps to reproduce

Try to open wt with muliple tabs and multiple profiles wt new-tab when there are spaces in the folder names.

Expected Behavior

Multiple tabs will be opened with multiple profiles

Actual Behavior

I can open multiple tabs with multiple profiles just fine when there are no spaces ion the folder names, but when I have spaces in the folder names and I have to enclose the path in quotes, I can only use a single profile in the beginning.

Originally created by @jordankittle on GitHub (Jul 28, 2021). ### Windows Terminal version (or Windows build number) 10.0.19041.1052 ### Other Software _No response_ ### Steps to reproduce Try to open wt with muliple tabs and multiple profiles wt new-tab when there are spaces in the folder names. ### Expected Behavior Multiple tabs will be opened with multiple profiles ### Actual Behavior I can open multiple tabs with multiple profiles just fine when there are no spaces ion the folder names, but when I have spaces in the folder names and I have to enclose the path in quotes, I can only use a single profile in the beginning.
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 04:17:46 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jul 28, 2021):

Can you give some example commandlines? wt -d "c:\program files" ; -d "c:\program files" seems to work just fine over here...

@zadjii-msft commented on GitHub (Jul 28, 2021): Can you give some example commandlines? `wt -d "c:\program files" ; -d "c:\program files"` seems to work just fine over here...
Author
Owner

@jordankittle commented on GitHub (Jul 29, 2021):

Thank you for looking into this. The problem must be that I have a dash in my user name. This results in the error:
wt -d "C:\Users\Jordan - Regular\Files\Web\Company\Projects\web-auth-backend" `; new-tab -p "Windows Powershell" -d "C:\Users\Jordan - Regular\Files\Web\Company\Projects\web-auth-backend" `; new-tab -p "Windows Powershell" -d "C:\Users\Jordan - Regular\Files\Web\Company\Projects\back-auth"

@jordankittle commented on GitHub (Jul 29, 2021): Thank you for looking into this. The problem must be that I have a dash in my user name. This results in the error: ```wt -d "C:\Users\Jordan - Regular\Files\Web\Company\Projects\web-auth-backend" `; new-tab -p "Windows Powershell" -d "C:\Users\Jordan - Regular\Files\Web\Company\Projects\web-auth-backend" `; new-tab -p "Windows Powershell" -d "C:\Users\Jordan - Regular\Files\Web\Company\Projects\back-auth"```
Author
Owner

@vefatica commented on GitHub (Jul 29, 2021):

Spaces and hyphens in the directory name seem OK. These work fine at a CMD prompt and a PowerShell prompt, respectively,

wt -d "v:\a - b" ; new-tab -p "Windows Powershell" -d "v:\a - b" ; new-tab -p "Windows Powershell" -d "v:\a - b"
wt -d "v:\a - b" `; new-tab -p "Windows Powershell" -d "v:\a - b" `; new-tab -p "Windows Powershell" -d "v:\a - b"

What is "the error"?

@vefatica commented on GitHub (Jul 29, 2021): Spaces and hyphens in the directory name seem OK. These work fine at a CMD prompt and a PowerShell prompt, respectively, ``` wt -d "v:\a - b" ; new-tab -p "Windows Powershell" -d "v:\a - b" ; new-tab -p "Windows Powershell" -d "v:\a - b" wt -d "v:\a - b" `; new-tab -p "Windows Powershell" -d "v:\a - b" `; new-tab -p "Windows Powershell" -d "v:\a - b" ``` What is "the error"?
Author
Owner

@jordankittle commented on GitHub (Jul 29, 2021):

The error is [error 0x8007010b when launching `powershell.exe']

@jordankittle commented on GitHub (Jul 29, 2021): The error is ```[error 0x8007010b when launching `powershell.exe']```
Author
Owner

@zadjii-msft commented on GitHub (Jul 29, 2021):

@jordankittle what version of the Terminal are you on? Somewhere in the 1.8-1.9 timeframe, we improved the messaging for that specific error (see #9114, #10045), which might help clarify

@zadjii-msft commented on GitHub (Jul 29, 2021): @jordankittle what version of the Terminal are you on? Somewhere in the 1.8-1.9 timeframe, we improved the messaging for that specific error (see #9114, #10045), which might help clarify
Author
Owner

@vefatica commented on GitHub (Jul 29, 2021):

That's ERROR_DIRECTORY (the directory name is invalid). I get it if I use "-d" with the name of a non-existent directory. I can only suggest you check those names:

"C:\Users\Jordan - Regular\Files\Web\Company\Projects\web-auth-backend"
"C:\Users\Jordan - Regular\Files\Web\Company\Projects\back-auth"
@vefatica commented on GitHub (Jul 29, 2021): That's ERROR_DIRECTORY (the directory name is invalid). I get it if I use "-d" with the name of a non-existent directory. I can only suggest you check those names: ``` "C:\Users\Jordan - Regular\Files\Web\Company\Projects\web-auth-backend" "C:\Users\Jordan - Regular\Files\Web\Company\Projects\back-auth" ```
Author
Owner

@jordankittle commented on GitHub (Jul 29, 2021):

They are valid names. I have double and triple checked. The first one works fine, the second errors, even when using the same exact -d name.

@jordankittle commented on GitHub (Jul 29, 2021): They are valid names. I have double and triple checked. The first one works fine, the second errors, even when using the same exact -d name.
Author
Owner

@jordankittle commented on GitHub (Jul 29, 2021):

I have verified that this error does not happen when I use the same exact script without the Jordan - Regular folder. It is only when using this folder that I get the error. And it is always the second instance of new-tab, not the first, even when using the exact same directory name.

@jordankittle commented on GitHub (Jul 29, 2021): I have verified that this error does not happen when I use the same exact script without the Jordan - Regular folder. It is only when using this folder that I get the error. And it is always the second instance of new-tab, not the first, even when using the exact same directory name.
Author
Owner

@jordankittle commented on GitHub (Jul 29, 2021):

What I am trying to do is build a shortcut that opens tabs to all my working directories for a project. After chasing this for hours, I am very sure there is a bug here.

@jordankittle commented on GitHub (Jul 29, 2021): What I am trying to do is build a shortcut that opens tabs to all my working directories for a project. After chasing this for hours, I am very sure there is a bug here.
Author
Owner

@vefatica commented on GitHub (Jul 29, 2021):

I had also tried it in the Run dialog (Win+R). Just now I tried it as the target of a shortcut. Both worked! So ... beats me! I'll be glad to hear what's going on.

@vefatica commented on GitHub (Jul 29, 2021): I had also tried it in the Run dialog (Win+R). Just now I tried it as the target of a shortcut. Both worked! So ... beats me! I'll be glad to hear what's going on.
Author
Owner

@jordankittle commented on GitHub (Jul 30, 2021):

I wish I could give you more information. If anybody from Microsoft wants to have a meeting where I share my screen let's do it .

@jordankittle commented on GitHub (Jul 30, 2021): I wish I could give you more information. If anybody from Microsoft wants to have a meeting where I share my screen let's do it .
Author
Owner

@vefatica commented on GitHub (Jul 30, 2021):

@jordankittle, fooling around with this, I just ran into an apparent 260 (MAX_PATH) character limit in a shortcut's command line. You're command line exceeds 260 characters also. And if cut off at 260, you're would be right in the middle of a (now bad) directory name. That's exactly what happened to me (and I got the same error as you). Did you try your command line at an actual command line (CMD ot PowerShell)? I wouldn't be surprised if it works there.

If that's the problem, it may be with the shortcut dialog (and not with shortcuts, per se). Maybe PowerShell or VBScript offers a way to create a shortcut that's not subject to that limitation.

@vefatica commented on GitHub (Jul 30, 2021): @jordankittle, fooling around with this, I just ran into an apparent 260 (MAX_PATH) character limit in a shortcut's command line. You're command line exceeds 260 characters also. And if cut off at 260, you're would be right in the middle of a (now bad) directory name. That's exactly what happened to me (and I got the same error as you). Did you try your command line at an actual command line (CMD ot PowerShell)? I wouldn't be surprised if it works there. If that's the problem, it may be with the shortcut dialog (and not with shortcuts, per se). Maybe PowerShell or VBScript offers a way to create a shortcut that's not subject to that limitation.
Author
Owner

@jordankittle commented on GitHub (Jul 30, 2021):

Wow, I feel a little silly now. Sorry for wasting your time! In my shortcut I have been using it was indeed cut off! Thank you very much and again I'm sorry I didn't catch this. In my shortcut I was using it was the very end that was cut off so that's why when I switched from "C:\Users\Jordan - Regular" to "C:\Users" it would work.

@jordankittle commented on GitHub (Jul 30, 2021): Wow, I feel a little silly now. Sorry for wasting your time! In my shortcut I have been using it was indeed cut off! Thank you very much and again I'm sorry I didn't catch this. In my shortcut I was using it was the very end that was cut off so that's why when I switched from "C:\Users\Jordan - Regular" to "C:\Users" it would work.
Author
Owner

@vefatica commented on GitHub (Jul 30, 2021):

FYI, the limitation is with the shortcut dialog, and not with shortcuts, per se. My shell has a SHORTCUT command. With it I made a working shortcut with a target well over 300 characters. AS I said before, you might be able to do that with VBScript, PowerShell, or some other tool.

@vefatica commented on GitHub (Jul 30, 2021): FYI, the limitation is with the shortcut dialog, and not with shortcuts, per se. My shell has a SHORTCUT command. With it I made a working shortcut with a target well over 300 characters. AS I said before, you might be able to do that with VBScript, PowerShell, or some other tool.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14720