[Debugger] vscode-cpptools should not launch a new terminal when using attach mode
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp, typescript, vscode
- Domain
- devtools
Research direction
Reproduce the issue using the provided launch.json, main.c, attach configuration, and GDB setup on Windows 10 with the remote RHEL environment if available. Start by tracing the attach-mode debugging flow and terminal creation; done means attaching to the process without opening the empty cppdbg terminal, with existing debugging behavior preserved.
Written by the indexing model from the issue text.
Description
Environment
- OS and version: Windows 10
- VS Code: 1.107.1
- C/C++ extension: 1.29.3
- OS and version of remote machine (if applicable): RHEL 8
- GDB / LLDB version: 16.3
Bug Summary and Steps to Reproduce
Bug Summary:
When using attach mode, vscode-cpptools should not start a new terminal. The terminal is always empty and useless.
Steps to reproduce:
-
Install
C/C++extension andTasks Shell Inputextension. -
launch.json:{ "version": "0.2.0", "configurations": [ { "name": "(gdb) Attach", "type": "cppdbg", "request": "attach", "program": "${workspaceFolder}/main", "processId": "${input:processID}", "MIMode": "gdb" } ], "inputs": [ { "id": "processID", "type": "command", "command": "shellCommand.execute", "args": { "command": "cat ${workspaceFolder}/main.pid", "useFirstResult": true } } ] } -
main.c:#include <stdio.h> #include <stdlib.h> #include <unistd.h> int main() { FILE *fp = fopen("main.pid", "w"); if (!fp) { return EXIT_FAILURE; } fprintf(fp, "%ld\n", (long) getpid()); fclose(fp); while (1) { puts("Hello"); sleep(3); } return EXIT_SUCCESS; } -
Compile and run:
gcc -g main.c -o main./main -
Run - Start Debugging
We need the "attach" mode because the actual program need a special way to launch.
But in "attach" mode, the terminal "cppdbg: main" is useless (and distracting). It will always be empty, because the program prints and reads at its own terminal.
Maybe vscode-cpptools should not launch a terminal when using attach mode, or we need an option at launch.json to make vscode-cpptools not to launch a terminal.
Debugger Configurations
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
"program": "${workspaceFolder}/main",
"processId": "${input:processID}",
"MIMode": "gdb"
}
],
"inputs": [
{
"id": "processID",
"type": "command",
"command": "shellCommand.execute",
"args": {
"command": "cat ${workspaceFolder}/main.pid",
"useFirstResult": true
}
}
]
}
Debugger Logs
N/A
Other Extensions
Tasks Shell Input (augustocdias.tasks-shell-input)
Additional Information
No response
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
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.
More from microsoft/vscode-cpptools
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/vscode-cpptools#14787 ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries Openbug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 1 assignee ·
-
Language Service more info needed
microsoft/vscode-cpptools#14778 · 1 comment · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 64/100
microsoft/vscode-cpptools#14769 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
microsoft/vscode-cpptools#14768 · 1 comment ·
All issues in microsoft/vscode-cpptools
Similar issues
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
agentic-workflows
Difficulty 1/5 Under an hour Newbie friendliness 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anomalyco/models.dev#7701 ·