Skip to content

Unknown characters were output in the built-in terminal. #302

@ZhanZiyuan

Description

@ZhanZiyuan

Behaviour

Debug a Python file C:\Users\user\Downloads\test.py in Visual Studio Code.

Steps to reproduce:

  1. Open C:\Users\user\Downloads\test.py in Visual Studio Code.

  2. Press F5.

  3. The built-in terminal launched.

  4. The output is printed, while it looks strange:

    & 'D:\Python\python.exe' 'c:\Users\user\.vscode\extensions\ms-python.python-2024.4.0\python_files\lib\python\debugpy\adapter/../..\debugpy\launcher' '55162' '--' 'C:\Users\user\Downloads\test.py' 
    y' ;f32e748c-078e-4722-b78a-88d04fc76110y' ;f32e748c-078e-4722-b78a-88d04fc761107.098666746304519
  5. However, if the Python file is run in the terminal instead of being debugged with Visual Studio Code, the issue will not occur:

    ❯ python C:\Users\user\Downloads\test.py
    7.098666746304519

Diagnostic data

launch.json configuration

{
    "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 the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

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 the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python Debugger)

Nothing.

2024-04-05_20-52-08

Metadata

Metadata

Assignees

Labels

triage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions