-
Notifications
You must be signed in to change notification settings - Fork 765
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
Wrong "export PATH" statement for Powershell Core #378
Comments
While that's true, i don't see the same special handling for |
@kirides thanks for the headsup. |
Change https://golang.org/cl/244378 mentions this issue: |
I've created a change which will do two of the above items: add I'm leaving this issue open to track progress on improving the integrated terminal detection further, starting with what @hyangah mentioned (https://github.com/microsoft/vscode-python/blob/649156a09ccdc51c0d20f7cd44540f1918f9347b/src/client/common/terminal/shellDetector.ts#L24-L35). |
This CL adds `pwsh` and several Linux shells to the list of supported shells. It also remove the Linux shell export command as the fallback. Updates #378 Change-Id: I43270344df2e53676e8993f3be81445c44d70d1c Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/244378 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
#146 (comment) @segevfiner suggested cc @mcjcloud |
@hyangah It is supposed to come with handling for those race conditions. |
microsoft/vscode#46696 is the overview of the API history, I am still struggling with the interaction with the terminal login shell. Then, when relaunching the terminal, it seems like the integrated terminal runs |
Maybe this microsoft/vscode#99878 And the current suggested workaround still requires to detect the underlying shell and send the right command. |
Also note that the Python extension does a similar thing for selecting Python/virtualenv so its something to look at. I actually won't be suprised if that API was created for it. But it might indeed still have issues, I'm not sure if the Python extension is using it yet either. |
Change https://golang.org/cl/245127 mentions this issue: |
… API vscode.ExtensionContext.EnvironmentVariableCollection is available since 1.46 (May 2020 release https://code.visualstudio.com/updates/v1_46#_environment-variable-collection) This API is specifically designed to help easy mutation of terminal environment, so we are trying to use it now. I hope this helps to address a couple of bugs related to the shell detection and the correct command and path escaping discovered during testing on Windows. Unfortunately, this API does not work well on Mac microsoft/vscode#99878 due to the peculiarity described in https://code.visualstudio.com/docs/editor/integrated-terminal#_why-are-there-duplicate-paths-in-the-terminals-path-environment-variable-andor-why-are-they-reversed So, we use the new API only for non-darwin OSes for now. On Mac, we send the command as done before unless users explicitly chose to use `-l` or `--login` parameter. And moved addGoRuntimeBaseToPATH to goEnvironmentStatus.ts because I think this is a better place. Updates golang#378 Change-Id: I56ada362fb422bca9c789eae30c6239cac5b4711
… API vscode.ExtensionContext.EnvironmentVariableCollection is available since 1.46 (May 2020 release https://code.visualstudio.com/updates/v1_46#_environment-variable-collection) This API is specifically designed to help easy mutation of terminal environment, so we are trying to use it now. I hope this helps to address a couple of bugs related to the shell detection and the correct command and path escaping discovered during testing on Windows. Unfortunately, this API does not work well on Mac microsoft/vscode#99878 due to the peculiarity described in https://code.visualstudio.com/docs/editor/integrated-terminal#_why-are-there-duplicate-paths-in-the-terminals-path-environment-variable-andor-why-are-they-reversed So, we use the new API only for non-darwin OSes for now. On Mac, we send the command as done before unless users explicitly chose to use `-l` or `--login` parameter. And moved addGoRuntimeBaseToPATH to goEnvironmentStatus.ts because I think this is a better place. Updates #378 Change-Id: I56ada362fb422bca9c789eae30c6239cac5b4711 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/245127 Reviewed-by: Brayden Cloud <bcloud@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Fixes for this is included in v0.16.0-rc.1 To install the rc version, download the vsix file from the release page, |
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gocode -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders17299e413d5590b14ab0340ea477cdd86ff13daf
x64
Extension: Check for Extension Updates
command)go env
to get the go development environment detailsset GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\USER\AppData\Local\go-build
set GOENV=C:\Users\USER\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=A:\Dev\Go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\USER\Desktop\go\langsrv\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\USER\AppData\Local\Temp\go-build460855558=/tmp/go-build -gno-record-gcc-switches
Share the Go related settings you have added/edited
Describe the bug
Using Powershell Core leads to this:
The Terminal is started using
pwsh.exe
as seen in configuration above. The name displayed in the integrated terminal switches todotnet
after booting up thepwsh.exe
Issue is simmilar to #314
Steps to reproduce the behavior:
pwsh.exe
(powershell core) as terminalThe text was updated successfully, but these errors were encountered: