-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Terminal doesn't handle PowerShell's space escape character correctly #33584
Comments
Not sure we should support this on the task/terminal config level as it seems very specific to PowerShell. What do you think @daviwil? |
I am not sure but from some testing I did in the past I had the impression that the space escaping for bash which uses \ is supported. The only difference is that PowerShell uses a different escape character. |
Hey guys, how does this come up in practice? You'd definitely need the backtick character to escape spaces when invoking PowerShell commands but typically people would surround strings containing spaces with single- or double-quotes, removing the need for space escaping. Any way you could use quotation marks instead of escaping spaces? |
Nothing special is done to support |
The backtick character is supported on native level in PowerShell as well. I think something is simply lost when the command line is finally passed to the PowerShell executable making the command fail. May be I expressed myself incorrectly. I am not asking to support backtick as a general space escaping mechanism and that we do some smartness to make backtick work on bash or cmd. But I do think that we should pass a string containing a backtick correctly to the PowerShell executable so that it can do the right thing. It came up for two reason: it was used in a task executed in a PowerShell environment. As a work around I told the user to use single quotes, but it makes it more complicated if the command uses already quotes. And I wanted to use it as well. When we resolve variables and they contain spaces the easiest on bash and PowerShell is to escape the space (e.g. consider ${file} resolves to a path containing spaces)). So for example a command like |
This issue has been closed automatically because it needs more information and has not had recent activity. Please refer to our guidelines for filing issues. Thank you for your contributions. |
Removing needs more info and reopening. |
I guess this would involve tinkering with the format to see what PowerShell expects then. Seems related to microsoft/node-pty#47, maybe backticks need to be escaped like https://github.com/Tyriar/node-pty/pull/47/files#diff-103714ba8ecf05b4f0425c2204698064R24? |
We would need to add special handling for PowerShell's backtick escaping since using backtick to escape space isn't universal. You can easily work around this by passing in a |
PowerShell supports back tick (`) as a space escape character. Using this when creating a terminal command for PowerShell makes the terminal fail.
For example dir folder
with
spacesThe command that is constructed starting the terminal is:
The text was updated successfully, but these errors were encountered: