vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

Debugging mingw application fail if using non-cmd as integrated terminal

Open alanlivio opened this issue 3 years ago • 4 comments

Brief Issue Summary

Debugging MinGW application fails if using non-cmd as an integrated terminal. I suggest vscode-cmake-tools always use cmd on windows

Example

For instance I using msys2 as integrated terminal.

  "terminal.integrated.profiles.windows": {
    "PowerShell": {
      "source": "PowerShell",
      "icon": "terminal-powershell"
    },
    "Command Prompt": {
      "path": [
        "${env:windir}\\Sysnative\\cmd.exe",
        "${env:windir}\\System32\\cmd.exe"
      ],
      "args": [],
      "icon": "terminal-cmd"
    },
    "Git Bash": {
      "source": "Git Bash"
    },
    "msys": {
      "path": "C:\\msys64\\msys2_shell.cmd",
      "args": [
        "-defterm",
        "-mingw64",
        "-no-start",
        "-use-full-path",
        "-here"
      ]
    }
  },
  "terminal.integrated.defaultProfile.windows": "msys",

When using "msys" as an integrated terminal, the following happens in the terminal but the debugging is not started.

image

When using "cmd" as an integrated terminal, the following happens and the debugging is started.

image

alanlivio avatar Jan 07 '22 18:01 alanlivio

I'm not 100% sure, but I don't think that our extension has any control over the terminal used to start debugging. @WardenGnaw, would this be a feature request for the VS Code team, or is this something we'd need to address in cpptools?

bobbrow avatar Jan 10 '22 18:01 bobbrow

This is either a mix of VS Code and MIEngine, the issue is we are using the Windows launcher for a shell that should be capable of unix styled pipes.

VS Code is running the cmd /C in MSYS, and we are assuming if we are on Windows, we should use the WindowsDebugLauncher. We will need a way in DAP to know that the terminal that is going to be used is MSYS.

WardenGnaw avatar Jan 11 '22 19:01 WardenGnaw

Thanks, @WardenGnaw. I think it is the right path.

alanlivio avatar Jan 15 '22 13:01 alanlivio

@WardenGnaw any news about this issue?

alanlivio avatar Aug 12 '22 10:08 alanlivio