-
Notifications
You must be signed in to change notification settings - Fork 137
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 Keyboard Inputs not being accepted #370
Comments
The same issue at the Ubuntu 18.04.3. But windows10 not. Test program is below: res = input("Enter something:") # Program stuck here. Stop the debugger.
print(res) |
Yes luckily downgrading the python interpreter solved this annoying issue. I had to uninstall VSCode, remove all extensions just to find out all I had to do was downgrade the latest python extension lol. |
@yousefabuz17 @dongchenyu163 Try adding @int19h we may need to handle this based on |
@karthiknadig ok I will definitely try that. Thanks for the feedback. I'm hoping a new update will be released soon so no one else will have this issue. |
I still haven't investigated why that happens, but I can confirm that I can reproduce it on Ubuntu while it still works on Windows. I tried just putting the stdin patching in place again, but it didn't seem to make any difference (so, it's probably related to something else). |
|
@mattmc318 you think so? I believe it's the Python Extension it's self that's the issue ever since the new update a couple days ago. Downgrading it obviously fixed the issue but it has to do with whatever they changed in the new update. @karthiknadig mentioned to add redirectOutput in launch.json while debugging but didn't work for me so. I'm also running this with Visual Studio Code on a Mac latest version. |
@yousefabuz17 Maybe not, then. I was just basing that assessment off of other comments. I'm new here, lol. It seems to work on Windows, but that could be just because it wasn't updated, or for any other reason besides it being platform-specific. |
One of the things that changed with the new version of the extension was the debugger version. We updated the extension to the latest debugger version. So when you downgrade the extension, you are automatically downgrading the debugger. |
@karthiknadig |
@zlcnup yea that didn't work for me either. I'm just waiting till a solution gets released or they simply update the python extension again |
It's the reverse - Also, the default for that setting already depends on |
This is a regression caused by 57ec4c4 - using a separate process group breaks terminal I/O, even though stdin is still propagated correctly. Need to revert that part of the change, and come up with a different way to manage the process tree. |
I re-test on pure local Win10 using |
Regardless "redirectOutput" settings "input" is broken on macOS Catalina and probably other versions as well. |
@int19h as a note, there's code to kill a process tree at https://github.com/microsoft/debugpy/blob/master/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_api.py#L975 (I don't think |
For anyone arriving here, there are currently no workarounds other then downgrading the python extension to a version below This issue currently affects This is a high-priority issue and it's already being worked on. |
@fabioz Yep, the adapter never imports pydevd at all, deliberately so. My other concern with that approach is that on Unix, walking the process tree manually and killing PIDs can potentially race with process termination & creation, so you can end up killing unrelated processes that just happened to reuse PIDs. It's exacerbated in "launch" cleanup scenario, because that one is often a race between the process terminating normally, and the launcher killing it. And while we can manage PID lifetime for the immediate debuggee (by not doing |
The hacky workaround is to remove this bit in debugpy that's bundled with the extension: debugpy/src/debugpy/launcher/debuggee.py Lines 63 to 66 in 57ec4c4
(In multi-process scenarios, this will also prevent subprocesses from being cleaned up in some cases, esp. if using Start without Debugging.) |
Make the debuggee process group the foreground group in its session. Add a test for input(), and improve existing stdin test to cover more cases.
So when will this fix be released? |
@SaadiSave hopefully soon but honestly I have no problem in using the roll back version. Simply downgrade python for now. Still works very fast with no issues |
I tried that. The API appears to be broken. It cannot find the old version. Could you send the link that you used to download the vsix for the old version? |
You can do it from VS Code, click on the gear icon for the extension and select "install another version": If you want to manually find and install older versions of the extension they can be found here: https://github.com/microsoft/vscode-python/releases |
Thank you |
This may solve this issue for the mean time. I have not tested it out yet as it was just mentioned. Thought I'd share it to anyone here. Hope it works. |
Bug: Python Interpreter Extension
------------------------------------------------------------------------------------------------->
Steps to cause the bug to occur
age = input("Enter age: )
print(age)
In the terminal when you type in a number or anything and then click enter, it would not accept the user input and took me awhile to realize its because of the new update.
Actual behavior
Terminal not accepting user inputs
Expected behavior
Terminal needs to accept user inputs in order to run the full code if necessary.
Solution:
Downgrade the python interpreter from 2020.8.101144 to one below it.
The text was updated successfully, but these errors were encountered: