Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode macOS c++ debug external console does nothing #5343

Closed
hellblazer33 opened this issue Apr 22, 2020 · 8 comments
Closed

vscode macOS c++ debug external console does nothing #5343

hellblazer33 opened this issue Apr 22, 2020 · 8 comments

Comments

@hellblazer33
Copy link

hellblazer33 commented Apr 22, 2020

Type: Debugger

Describe the bug

I am on vscode on mac trying to debug c++ In program where we have to input but it doesnt work as vscode launches external console(terminal) but nothing happens in the terminal.

I am using "externalConsole: true" the terminal launches but debugger doesnt work after launching terminal and nothing happens.

if "externalConsole: false" and program without input then it works perfectly.
I think its problem with latest vscode update for macos.I have windows too and there external console works perfectly while debugging.

  • OS and Version: MacOS Catalina 1.44.2
  • VS Code Version: 1.44.2
  • C/C++ Extension Version: 0.27.0

here is my launch.json config.

   {
  "version": "0.2.0",
  "configurations": [
    
    {
      "name": "clang++ - Build and debug active file",
      "type": "cppdbg",
      "request": "launch",
      "program": "${fileDirname}/${fileBasenameNoExtension}",
      "args": [],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}",
      "showDisplayString": false,
      "environment": [],
      "externalConsole": true,
      "internalConsoleOptions": "openOnSessionStart",
      "MIMode": "lldb",
      "logging": {
        "moduleLoad": false,
        "programOutput": true,
        "trace": false
      },
      "preLaunchTask": "clang++ build active file",
      "osx": {
        "MIMode": "lldb" 
      }
    }

Here is the code i am trying to debug.
`

#include<iostream>
using namespace std;

int main(){
    int a,b,s;
     a=5;
     cout<<"Enter Number";
     cin>>b;
    if((a<200)&&(b<200)){
        s = a + b;
        cout<<s<<endl;
    }
    return 0;
}

log
--> R (setFunctionBreakpoints-5): {"type":"response","request_seq":5,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]},"seq":167} <-- C (configurationDone-6): {"command":"configurationDone","type":"request","seq":6} --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3090) Send Event AD7LoadCompleteEvent\n"},"seq":171} 1: (3090) Send Event AD7LoadCompleteEvent --> R (configurationDone-6): {"type":"response","request_seq":6,"success":true,"command":"configurationDone","body":{},"seq":170} --> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"Warning: Debuggee TargetArchitecture not detected, assuming x86_64.\n"},"seq":174} Warning: Debuggee TargetArchitecture not detected, assuming x86_64. --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3100) <-1012-exec-run\n"},"seq":176} 1: (3100) <-1012-exec-run <-- C (threads-7): {"command":"threads","type":"request","seq":7} --> R (threads-7): {"type":"response","request_seq":7,"success":true,"command":"threads","body":{"threads":[]},"seq":179}

@WardenGnaw WardenGnaw added debugger investigate This issue needs to be investigated/confirmed labels Apr 22, 2020
@omcnoe
Copy link

omcnoe commented May 9, 2020

I am having the same experience, Terminal.app pops up, but no debug session starts...

@Diffumist
Copy link

Diffumist commented May 10, 2020

I had the same problem with Manjaro KDE before, but when I changed terminal.external.linuxExec to kconsole (KDE's default terminal) the problem was solved, but it didn't work in Mac OSX, I think it was a problem with VScode's call to terminal.

image

@hellblazer33
Copy link
Author

I had the same problem with Manjaro KDE before, but when I changed terminal.external.linuxExec to kconsole (KDE's default terminal) the problem was solved, but it didn't work in Mac OSX, I think it was a problem with VScode's call to terminal.

image

I posted to vscode github too but they said there is no problem with it and its a problem with cpp extension

@omcnoe
Copy link

omcnoe commented May 10, 2020

This is the the same issue as #5079, the workaround from that issue #5079 (comment) worked for me.

@WardenGnaw WardenGnaw added duplicate and removed investigate This issue needs to be investigated/confirmed labels May 10, 2020
@WenshengGe
Copy link

WenshengGe commented Dec 28, 2020

Same problem on macOS Big Sur.
The only thing working is to launch vscode from a terminal (with code). externalConsole work as expected.

@pythonreactor
Copy link

Same problem on macOS Big Sur.
The only thing working is to launch vscode from a terminal (with code). externalConsole work as expected.

Can you explain what you mean? Maybe throw some steps up? Thanks @WenshengGe

@wrist
Copy link

wrist commented Feb 22, 2021

I also came accross the problem.
At first, I installed code command from VSCode command pallet invoked by Shift+Cmd+p with the below command.
image
Then, I executed code command from Terminal.app to launch new Visual Studio Code instance.
In such way, "externalConsole": true setting worked as expected too.

@lionelr96
Copy link

Has there been any update on this issue since?

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

No branches or pull requests

8 participants