Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.67.0 OS Version: Windows 10, using as a default shell Steps to Reproduce: When debugging python(I think debuggers of other languages also got effected too), I'm using following to redirect stdin to my custom input file. This method of implementing redirection when debugging using the < character is also introduced in the . According to the document, This approach requires that the "<" syntax is passed through the debugger extension and ends up unmodified in the Integrated Terminal. and it worked like charm before updating to . From , I've noticed that there was a fix related to automatically add escape character() before special symbols such as or (See Terminal on Windows uses cmd /C, this corrupts passed arguments) When I started debugging session, vscode is now really add before . Since character is escaped, I cannot used redirection with the method mentioned in the document anymore. Is this the intended result? If so, how to use redirection 'correctly' after this build? I know a lot of people redirect stdin to and redirect stdout to when debugging, which is actually very convenient. I think that implementing redirection by passing special characters(, , ) as arguments of the debugger is not a very graceful solution, but that method itself should not be eliminated.
Having the same issue with new version in WSL. It seem some characters are prefix with . My is . But in console, the command is , due to prefix , my code is stuck. It was working fine yesterday, So, I think this issue is with new release. VS Code Version: 1.67.0 OS Version: Windows 10, WSL Ubuntu20.04
Judjung from of , I'm sure this issue is related to today's release too.
Yeah this is Thanks for pointing out the docs, I didn't know this was recommended. It's suspicious to me that we would want to put shell-specific syntax in the args here. That isn't what "args" means to me. I wonder whether we could add launch config parameters like "stdinFromFile" and "stdoutToFile" (and add those to the runInTerminal request) so that vscode can come up with the right syntax for the shell. I may want to revert the change until we have a better solution. Thoughts Maybe candidate
I'm not a fan of allowing this. We already try to escape things from those arguments, so people doing this today have only a half-working shell syntax in their arguments. It also only works if you run it in the , and is of course shell-dependent too, which feels weird.
This is super messed up. I 100% require being able to redirect the output. This needs to be fixed. ages: ["",""] was 100% working on windows before this update! My work flow is screwed rn
Args mean arguments as if I was writing it after typing it in console including SHELL commands. I want to redirect output Why in the world it would add ^is crazy to me. This has to be be bug.
Additional sometimes you need to chain aliases that take redirect or pass a redirect back in < These are shell scripts that having the debugger "args" accept <,,| is really important to have. It was an amazing and highly convenient way to debug. I seriously doubt this is a feature that few people would want deprecated. I seriously don't and it's killing me it broke after this update.
Yeah I agree that passing redirection symbols through args is somewhat weird, and I understand the need for escaping shell-specific characters. That's why I've said it's not a graceful solution. However, many people uses the redirection feature through that way now(even if the docs have been mislead the users). It's good improvement to escape that characters in arguments since it is literally "argument", but I think there should be official solution to redirect I/O. As mentioned above, add parameters such as "stdinFromFile" and "stdoutToFile" to might be best solution. BTW, what kind of additional information do I have to add here? I think I mentioned all the details of the sitution but I see the "needs more info" label.
I've spent 3 hours trying to come up with a work around. This is insane. So much of my workflow relied on the ability the redirect stdin and stdout using <,. It's insane that this was deprecated. I don't even get why. It doesn't have to do any crazy checking should just copying what you type in and the shell takes over. This is a serious issue for me. !
If it's about "escaping shell-specific characters" then I could live with this. And if it's about anything else shell then give me something like this:
Sorry for the trouble. Like I said, I didn't realize that people were depending on this behavior, and I agree that it should be supported somehow, since this is a reasonable and useful workflow. To me, "args" means arguments that get passed to the program you are starting. I see a couple solutions Restore the behavior of and require users to shell-escape args in their own config, which is not good, or add which would be shell-escaped Keep the behavior of and add or , or the more specific Any of this will require changes to DAP. I wonder whether anyone is trying to use any shell syntax besides /<, in other words, is there a scenario that adding wouldn't cover?
In my opinion, the second way Keep the behavior of and add or , or the more specific is better workaround since we can prevent use of different way from its real meaning.
just a few comments from vacation... VS Code knows nothing about properties. Some debug extensions introduce in their schema contribution but VS Code cannot provide any direct help with redirecting input/output. VS Code supports/implements the DAP request which some debug extensions use to implement their (private) support. does not allow direct access to shell features (e.g. input/output redirection) because no assumptions can be made about the underlying shell or whether a shell is used at all. So escaping/quoting all shell meta-characters is correct. But we might want to add additional features to the DAP request so that debug adapters can implement / property support themselves. a debug extension can introduce an alternative property that supports shell features, e.g. a property . In order to support this we would have to add support to the DAP request to pass a full command line unchanged to the underlying shell.
is there a scenario that adding stdinFromFile/ stdoutToFile wouldn't cover? Yes. I for one will use aliases that are shell scrips to redirect their input and output to chain together programs.
Yes, this is basically my thinking. But I think I should revert the change as a candidate until we figure out a better solution. could you give me an example so I understand how that wouldn't be covered by this proposal?
"stdinFromFile/stdoutToFile" makes the most sense to me. I would not be in favor of a option in the request since, similar to the initial problem, the DA has no knowledge of the underlying shell.
I wonder whether we could make everyone happy in the meantime by leaving the current fix but special-casing and and not escaping these? You could have the and filename in a single arg but I don't see anyone doing that. And it would make the behavior almost the same as the intended escaping behavior.
If would work with "" instead of "", "" I could live with that. Or what ever you mean by special-casing. I just want it to work again or have some means to do to it again.
I mean the opposite (the in would not be escaped, and in would be escaped)
that seems like an acceptable interim fix to me. As a C++ debug extension author (vGDB), this has also broken my extension on the most recent VSCode build and I've had to suggest users defer on upgrading for now to not break existing workflows.
Thanks. I am going with this solution for the .2 build that will go out next week. Not a perfect fix - as a single argument would have previously redirected output too - but people are using or in all the examples I have seen so far. It will also be in Insiders tomorrow. I noticed another issue with the escaping, , which will also get fixed in Insiders
thanks for the quick fix!

Discussion:
const cmd = quote(args.shift()!); command += (cmd[0] === ''') ? `& ${cmd} ` : `${cmd} `; for (const a of args) { <del> command += `${quote(a)} `; </del> <ins> command += (a === '<' || a === '>') ? a : quote(a); command += ' '; </ins> } } break;

} } for (const a of args) { <del> command += `${quote(a)} `; </del> <ins> command += (a === '<' || a === '>') ? a : quote(a); command += ' '; </ins> } if (env) { command += '"';

command += ' '; } for (const a of args) { <del> command += `${quote(a)} `; </del> <ins> command += (a === '<' || a === '>') ? a : quote(a); command += ' '; </ins> } break; }