Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jordankittle opened this issue Jul 28, 2021 · 14 comments
Closed

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

jordankittle opened this issue Jul 28, 2021 · 14 comments
Labels
Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@jordankittle
Copy link

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.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 28, 2021
@zadjii-msft
Copy link
Member

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

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 28, 2021
@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 29, 2021
@jordankittle
Copy link
Author

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"

@vefatica
Copy link

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"?

@zadjii-msft zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jul 29, 2021
@jordankittle
Copy link
Author

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

@zadjii-msft
Copy link
Member

@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

@vefatica
Copy link

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"

@jordankittle
Copy link
Author

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.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 29, 2021
@jordankittle
Copy link
Author

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
Copy link
Author

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.

@vefatica
Copy link

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.

@jordankittle
Copy link
Author

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 .

@vefatica
Copy link

@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.

@jordankittle
Copy link
Author

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.

@vefatica
Copy link

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

3 participants