-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Calling wt from cmd for working directory "C:\" causes an error #4571
Comments
Interesting. It looks like we're not handling quotes properly when there aren't spaces. |
Unfortunately this is the default behavior if the command line gets tokenized to |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Similarly I'm trying to set a context menu shortcut via registry to open terminal from a folder's background context menu. I used to do this successfully with cmder by setting the command to Trying this with I tried changing the command to
|
As a quick hack for %V, you might be able to use.. hmm. |
I have it working with a userprofile of Ubuntu-18.04, but what I'm wondering is what the error as described in the issue is coming from, |
You're getting that error because you have a specified a working directory (with |
Thanks, this seems this works everywhere I've tried so far. |
Triaged this into 1.0; we should see if there's something we can do about it. |
I can take this and solve it along with #4170. I recall that I already have a piece of code to parse the command line somewhere in my snippet collection. Likely still in C though. @zadjii-msft Do you think we need an alternative way to preserve literal quotes in the arguments? Or would it be OK to have them removed after tokenization? From what I see in the docs I'd guess it's save to strip them all. |
(Sorry I deleted my comment earlier.) I personally think that the terminal should stay consistent with other apps and use the standard Should we really fix this in the terminal? Is this not cmd.exe/Powershell's own problem? Other apps behave like this as well: Powershell:
cmd:
It looks like cmd.exe just passes the whole command line to the app while powershell parses the command line with its own rules and then escapes the arguments to recreate a command line. In particular, powershell doesn't care about backslashes so |
Good point @greg904. But it doesn't behave the same in all shells and unfortunately it's not only a problem of the CMD. It fails from within the Run dialog and it fails also from a shortcut. |
was struggling with |
Just to confirm, you are starting powershell, to start cmd, to start WT, to start powershell. Why is your invocation three commands when just one would be fine? That’s crazy. |
I've been using these context menu shortcuts: to be able to easy open "Open command/bash window here as administrator" but I've not found any hint on how to create the same for Windows Terminal? Actually there are still two more escapes missing from |
@3col is there any reason you can’t just use |
I see: you want the |
Hi,
I was testing the new command line options to open a Windows Terminal for a specified working directory. When calling
wt new-tab -d "C:\"
from PowerShell this seems to work. Calling the same command from cmd however will print the error message[error 0x8007010b when launching
powershell.exe']` in the newly opened Windows Terminal instance. Using the "-p" option to launch a different shell will provoke the same error message for the executable associated with the specified profile name.Environment
Steps to reproduce
Call
wt new-tab -d "C:\"
from cmd.Expected behavior
Open a new Windows Terminal tab with path
C:\
set as the current working directory.Actual behavior
Opens a Windows Terminal instance with the message:
[error 0x8007010b when launching `powershell.exe']
The text was updated successfully, but these errors were encountered: