mirror of
https://github.com/nushell/nushell
synced 2024-12-28 05:53:09 +00:00
correctly escape pipe in windows/cmd.exe (#3489)
* correctly escape pipe in windows/cmd.exe * add some comments, take out debug line
This commit is contained in:
parent
ac38ee82f4
commit
65ee7aa372
1 changed files with 3 additions and 1 deletions
|
@ -150,7 +150,9 @@ fn spawn(
|
|||
process.arg(&command.name);
|
||||
for arg in args {
|
||||
// Clean the args before we use them:
|
||||
let arg = arg.replace("|", "\\|");
|
||||
// https://stackoverflow.com/questions/1200235/how-to-pass-a-quoted-pipe-character-to-cmd-exe
|
||||
// cmd.exe needs to have a caret to escape a pipe
|
||||
let arg = arg.replace("|", "^|");
|
||||
process.arg(&arg);
|
||||
}
|
||||
process
|
||||
|
|
Loading…
Reference in a new issue