Closed ZhanZiyuan closed 4 months ago
@ZhanZiyuan Can you share logs from Output > Python? this seems like it might be coming from python extension trying to activate the environment.
@ZhanZiyuan Can you share logs from Output > Python? this seems like it might be coming from python extension trying to activate the environment.
OK. Here are logs from Output
> Python
:
I found that when switching between Output
and Terminal
, what's printed in Terminal
occasionally becomes normal:
Good afternoon! I have the same problem. When running the script, the "c" character gets into the terminal, then an error occurs and then the script is executed.
I have the same problem. Some additional info: for the first time that the "Python Debug Console" terminal window is launched, the script is started and the debug session works. However, if I want to debug again, it does not work in Git Bash, and behaves strangely in PowerShell.
Output in GitBash First try:
Second try:
Output in PowerShell First try:
Second try:
EDIT: There are no issues with version 1.87.2.
@Tyriar This looks like it might be coming from shell integration.
@karthiknadig that guid could be the set command line nonce if it's not something the extension is inputting 🤔
@ZhanZiyuan what version of Windows are you on?
@karthiknadig that guid could be the set command line nonce if it's not something the extension is inputting 🤔
@ZhanZiyuan what version of Windows are you on?
Hello. My OS Version: Windows 10.0.19045
I'm also using the latest stable release of Visual Studio Code (version 1.88).
This is likely a very old version of conpty misbehaving as it's shipped with Windows and you're still on 10. So a workaround is to disable shell integration, the real fix is to update to Windows 11.
This is likely a very old version of conpty misbehaving as it's shipped with Windows and you're still on 10. So a workaround is to disable shell integration, the real fix is to update to Windows 11.
Alright, many thanks for your reply though the computer is not eligible to upgrade to Windows 11.
This is likely a very old version of conpty misbehaving as it's shipped with Windows and you're still on 10. So a workaround is to disable shell integration, the real fix is to update to Windows 11.
I have this problem on Windows 11 as well. However it might be independent of the Python Debugger itself, as there are no issues with VsCode version 1.87.2, only with 1.88.
The problem is only present when using "console": "integratedTerminal"
.
I have encountered similar issue when I update to VSC 1.88.1 and it is solved when I revert to 1.87.2 When I debug a Python file, for the first time, everything works normally. However, if I restart it or stop and debug again, it goes wrong. Although from the Outoput, I can see the command text is sent to Terminal, there is no text shown on the Terminal. Seconds later, a TimeOut error raised.
Another walkaround is setting "console" as "internal Console" in launch.json
My Windows version is 22631.3527
I have another PC with a Windows Canary Insider Preview 26200.5001 And VSC 1.88.1 works well.
Closing the issue as the error is on vscode side.
Behaviour
Debug a Python file
C:\Users\user\Downloads\test.py
in Visual Studio Code.Steps to reproduce:
Open
C:\Users\user\Downloads\test.py
in Visual Studio Code.Press F5.
The built-in terminal launched.
The output is printed, while it looks strange:
However, if the Python file is run in the terminal instead of being debugged with Visual Studio Code, the issue will not occur:
Diagnostic data
launch.json
configuration```json { "version": "0.2.0", "configurations": [ { "name": "Python: 当前文件", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal", "justMyCode": true }, { "name": "C/C++: gcc.exe 生成和调试活动文件", "type": "cppdbg", "request": "launch", "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", "args": [], "stopAtEntry": false, "cwd": "${fileDirname}", "environment": [], "externalConsole": false, "MIMode": "gdb", "miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe", "setupCommands": [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "description": "将反汇编风格设置为 Intel", "text": "-gdb-set disassembly-flavor intel", "ignoreFailures": true } ], "preLaunchTask": "C/C++: gcc.exe 生成活动文件" } ] } ```
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)```log 2024-04-05 20:11:01.495 [info] DAP Server launched with command: D:\Python\python.exe c:\Users\user\.vscode\extensions\ms-python.python-2024.4.0\python_files\lib\python\debugpy\adapter 2024-04-05 20:11:03.265 [info] Send text to terminal: & 'D:\Python\python.exe' 'c:\Users\user\.vscode\extensions\ms-python.python-2024.4.0\python_files\lib\python\debugpy\adapter/../..\debugpy\launcher' '55037' '--' 'C:\Users\user\Downloads\test.py' ```
Output for
Python Debugger
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython Debugger
)```log Nothing. ```