microsoft / microsoft/vscode-cpptools
Can not show terminal inputs when break `readline()`
Open
Nobody has claimed this yet.
debugger
more info needed
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and version: Windows 10
- VS Code: 1.77.3
- C/C++ extension: v1.15.2
- OS and version of remote machine (if applicable): Ubuntu 22.04
- GDB / LLDB version: GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Bug Summary and Steps to Reproduce
Bug Summary:
When use readline() and break(Shift + F5 or Ctrl + C) the program, terminal will not display inputs. (But still can execute commands).
Steps to reproduce:
- create
echo.c:
#include <stdio.h>
#include <readline/history.h>
#include <readline/readline.h>
int main() {
char* line = NULL;
while (line == NULL || strcmp(line, "q") != 0) {
line = readline("> ");
printf("%s\n", line);
}
return 0;
}
- Press
F5to debug program. - Press
Shift + F5orCtrl + C. cppdbgterminal will not show inputs.- Inputs will display normally if enter
q.
Debugger Configurations
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/echo.out",
"cwd": "${workspaceFolder}",
"externalConsole": false,
"MIMode": "gdb",
"preLaunchTask": "gcc"
}
]
}
task.json:
```json
{
"version": "2.0.0",
"tasks": [
{
"label": "gcc",
"type": "shell",
"command": "gcc echo.c -g -lreadline -oecho.out"
}
]
}
### Debugger Logs
```shell
Maybe no needs.
Other Extensions
No response
Additional Information
No response
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
Reproduce the issue with echo.c using the shown launch.json and task.json, then interrupt the readline() session with Shift+F5 or Ctrl+C and compare terminal input rendering before and after entering q. Start by tracing the cppdbg terminal and debugger interruption path; done means inputs remain visible after interruption and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100