Skip to content

Can not show terminal inputs when break readline() #10865

Description

@Koishiiko

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:

  1. 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;
}
  1. Press F5 to debug program.
  2. Press Shift + F5 or Ctrl + C .
  3. cppdbg terminal will not show inputs.
  4. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    debuggermore info neededThe issue report is not actionable in its current state

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions