-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
STDIN/STDOUT redirection of debugger doesn't work anymore after 1.67 update #148887
Comments
Having the same issue with new version in WSL. It seem some characters are prefix with
|
Judjung from commit log of |
Yeah this is #145265. 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 @isidorn @weinand @connor4312? 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 |
This is super messed up. I 100% require being able to redirect > the output. This needs to be fixed. ages: [">","out.txt"] 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. 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 launch.json 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. |
@hw0603 |
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:
|
vscode 파이썬 디버그 할 때 표준입출력을 원하는 파일로 연결되도록 설정했습니다. 그런데 어제 vscode 1.67 패치로 정상실행이 안되네요. microsoft/vscode#148887 그래도 편하게 쓰던 기능이라 같이 올립니다.
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
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 |
In my opinion, the second way
is better workaround since we can prevent use of |
@roblourens just a few comments from vacation...
|
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.
@boardkeystown 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 |
I wonder whether we could make everyone happy in the meantime by leaving the current fix but special-casing |
If would work with "> out.txt" instead of ">", "out.txt" 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 |
@roblourens 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 - It will also be in Insiders tomorrow. I noticed another issue with the escaping, #149283, which will also get fixed in Insiders |
@roblourens thanks for the quick fix! |
Does this issue occur when all extensions are disabled?: Yes
cmd.exe
as a default shellSteps to Reproduce:
When debugging python(I think debuggers of other languages also got effected too), I'm using following
launch.json
to redirect stdin to my custom input file.This method of implementing redirection when debugging using the < character is also introduced in the official documentation of vscode.
According to the document,
and it worked like charm before updating to
v1.67.0
.From changelog of v1.67, I've noticed that there was a fix related to automatically add escape character(
^
) before special symbols such as<
or|
(See 145265 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 input.txt and redirect stdout to output.txt 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.The text was updated successfully, but these errors were encountered: