VS代码调试器不再接受输入



奇怪的是,VS Code停止接受来自集成和外部终端的输入。一个小时前,它还在拱门上以鱼为壳工作。如果我运行以下Python代码,例如:

print('Please enter a number: ', end='')
a = float(input())
print(f'Your number is: {a}')

然后我键入1并点击Enter,光标移动到下一行,所有执行都停止。调试器仍然在运行,就好像我没有输入任何内容一样,但终端正在显示我的输入。当我点击停止时,我看到错误";1000ms后超时";作为VS代码右下角的警报。

Python:Current File选项生成后,我没有对launch.json进行任何更改。为了清楚起见,代码在这里:

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}

通过阅读文档,我没有找到任何解决方案。这只是一个会被修复的错误,还是我做错了什么?

编辑

从shell执行代码通常按预期运行。

https://github.com/microsoft/vscode-python/issues/13449检查一下,尝试将扩展降级回另一个版本。

最新更新