microsoft / microsoft/vscode-cpptools
External terminal when debugging in WSL
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Hello,
Firstly I would like to say thank you for this awesome text editor and the C/C++ extension :)
I tried debugging C/C++ program in Windows Subsystem for Linux. The debugging session works fine but the only problem is that VS Code won't open an external terminal so I could not get stdout and stdin from a terminal during the debugging session.
So I have two questions:
- How can I open an external terminal for WSL debugging?
- Even there is not external terminal, how to get output from
stdoutand input tostdinduring the debugging session?
Here is my launch.json, as you can see I set "externalConsole": true but an external terminal won't appear:
{
"name": "maze_solver",
"type": "cppdbg",
"request": "launch",
"program": "maze_solver",
"args": [],
"stopAtEntry": false,
"cwd": "./",
"environment": [],
"externalConsole": true,
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
"pipeProgram": "C:\\Windows\\sysnative\\bash.exe",
"pipeArgs": ["-c"],
"pipeCwd": "${workspaceFolder}/simulation/maze_solver"
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"sourceFileMap": {
"/mnt/d": "d:\\"
},
"logging": { "engineLogging": true }
}
Thank you very much!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the launch.json configuration, especially externalConsole and pipeTransport, and reproduce the C/C++ debugging session under WSL. Trace how the extension handles external terminals and standard input/output for this setup. Done means WSL debugging opens a usable external terminal or clearly supports stdin and stdout through the documented alternative.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, cpp, vscode
- Domain
- devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100