microsoft / microsoft/vscode-cpptools

Unable to view program output when running debugger from Windows -> WLS

Open
#1,977 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

I am building the program in WLS and Launching it from Windows natively. Everything works fine, I can step through the program except that I cannot view any stdout because there is no console opening upon the start of a debug session

here is my launch.json file:

{
// 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": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "/mnt/c/Shared/x/program",
"args": [""],
"stopAtEntry": true,
"cwd": "/mnt/c/Shared/x/program/",
"environment": [],
"externalConsole": false,
"windows": {
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
"pipeTransport": {
"pipeCwd": "",
"pipeProgram": "c:\windows\sysnative\bash.exe",
"pipeArgs": ["-c"],
"debuggerPath": "/usr/bin/gdb"
},
"sourceFileMap": {
"/mnt/c": "c:\"
}
}
]
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the debug session described in launch.json, focusing on pipeTransport, externalConsole, and the Windows-to-WSL paths. Check how stdout is expected to appear when launching the C++ program through bash.exe and gdb. Done means program output is visible during the debug session without breaking stepping.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.