-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Comments
Can you give some example commandlines? |
Thank you for looking into this. The problem must be that I have a dash in my user name. This results in the error: |
Spaces and hyphens in the directory name seem OK. These work fine at a CMD prompt and a PowerShell prompt, respectively,
What is "the error"? |
The error is |
@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 |
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:
|
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. |
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. |
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. |
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. |
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, 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. |
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. |
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. |
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.
The text was updated successfully, but these errors were encountered: