Open tommynanny opened 6 months ago
The extension currently does not use the terminal for debugging.(The debug feature predates the integrated terminal features and options).
Can you copy the env vars to "go.toolsEnvVar"
for now?
The extension currently does not use the terminal for debugging.(The debug feature predates the integrated terminal features and options). Can you copy the env vars to
"go.toolsEnvVar"
for now?
@hyangah Sure
...
"terminal.integrated.profiles.windows": {
// add profile MSYS2
"mingw64": {
"path": "C:\\msys64\\usr\\bin\\bash.exe",
"args": [
"--login",
"-i"
],
"env": {
"MSYSTEM": "MINGW64",
"CHERE_INVOKING": "1",
"MSYS2_PATH_TYPE": "inherit"
},
"overrideName": true
},
// "mingw64": {
// "path": "C:/msys64/msys2_shell.cmd",
// "args": [
// "-defterm",
// "-here",
// "-no-start",
// "-mingw64"
// ]
// }
},
"go.toolsEnvVar": {
"MSYSTEM": "MINGW64",
"CHERE_INVOKING": "1",
"MSYS2_PATH_TYPE": "inherit"
},
...
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
* Run `go version` to get version of Go from _the VS Code integrated terminal_. - go version go1.21.6 windows/amd64 * Run `gopls -v version` to get version of Gopls from _the VS Code integrated terminal_. - golang.org/x/tools/gopls v0.14.2 * Run `code -v` or `code-insiders -v` to get version of VS Code or VS Code Insiders. - 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2 x64) * Check your installed extensions to get the version of the VS Code Go extension - 0.40.1 * Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > `Go: Locate Configured Go Tools` command. -
Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file. Share all the settings with thego.
or["go"]
orgopls
prefixes.Describe the bug
I have configured VS Code to use the MinGW64 terminal from MSYS2 as my integrated terminal for Go development. This configuration includes setting specific environment variables to ensure that the terminal uses the MinGW64 environment. My settings.json includes the following relevant settings:
However, when I start a debug session using the integrated terminal, it defaults to the MSYS environment instead of MinGW64. This behavior suggests that the debug session might not be inheriting or respecting the environment variables set for the MinGW64 terminal profile. Specifically, it seems to ignore the "MSYSTEM": "MINGW64" setting, which is crucial for my development environment.
This issue causes significant problems in my build and debug process, as my project requires the MinGW64 environment for proper compilation and execution, especially when dealing with cgo dependencies.
I expect the debug session to start in the MinGW64 environment, inheriting the integrated terminal's configuration, including the environment variables set in settings.json. This should ensure compatibility with my project's build requirements and allow for a seamless debugging experience.
Steps to reproduce the behavior:
Configure VS Code to use MSYS2's MinGW64 as the integrated terminal. Set up a Go project that requires MinGW64 (e.g., a project using cgo with MinGW64 dependencies). Start a debug session in VS Code. The terminal defaults to MSYS instead of MinGW64.