Skip to content

Macbook M1 - debugger, scanf does not read from console #9025

Open
@mosmar99

Description

@mosmar99

Bug type: Debugger

Describe the bug

  • OS and Version: Monterey
  • VS Code Version: Insiders edition
  • C/C++ Extension Version: 1.93
  • Other extensions you installed (and if the issue persists after disabling them): C/C++ debug extension
  • A clear and concise description of what the bug is. I can't read from standard input, i.e. terminal. In addition, I can't get the debugger working for C with an external terminal. It opens two terminals which are disconnected from the debugging process. When I do enter, say an integer, into the terminal, I just get the error: "Unable to perform this action because the process is running." Which I presume is due to standard input being disconnected from the debugger and the file as a whole, more or less.

To Reproduce
Please include a code sample and launch.json configuration.

Launch:
{ // 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": "(lldb) Launch", "type": "cppdbg", "request": "launch", "targetArchitecture": "x86_64", "program": "${workspaceFolder}/${fileBasenameNoExtension}.x86_64", "args": [], "stopAtEntry": true, "cwd": "${fileDirname}", "environment": [], "externalConsole": false, "osx": { "preLaunchTask": "build (x86_64)", "MIMode": "lldb" } } ] }

Tasks:
{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "build (x86_64)", "type": "shell", "command": "clang", "args": [ "-arch", "x86_64", "-g", "-o", "${workspaceFolder}/${fileBasenameNoExtension}.x86_64", "${fileDirname}/${fileBasename}" ], "group": "build" }, { "label": "build (arm64)", "type": "shell", "command": "clang", "args": [ "-arch", "arm64", "-g", "-o", "${workspaceFolder}/${fileBasenameNoExtension}.arm64", "${fileDirname}/${fileBasename}" ], "group": "build" }, { "label": "build (Mach-O Universal)", "type": "shell", "command": "lipo", "dependsOn":["build (x86_64)", "build (arm64)"], "args": [ "-create", "-output", "${workspaceFolder}/${fileBasenameNoExtension}", "${workspaceFolder}/${fileBasenameNoExtension}.x86_64", "${workspaceFolder}/${fileBasenameNoExtension}.arm64" ], "group": { "kind": "build", "isDefault": true } } ] }

Create a new c file, test.c.
Try running the code:
`#include <stdio.h>

int main(void) {
int test;
printf("hello");
scanf("%d", &test);
return 0;
}`

As a computer science student debugging is of vital importance for more or less all of my assignments. Solving this issue would heavily facilitate my workflow.
Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions