Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Correctly detect powershell when ssh to windows machine.#4874

Open
hetong07 wants to merge 1 commit intodocker-archive-public:masterfrom
hetong07:shell-windows
Open

Correctly detect powershell when ssh to windows machine.#4874
hetong07 wants to merge 1 commit intodocker-archive-public:masterfrom
hetong07:shell-windows

Conversation

@hetong07
Copy link

@hetong07 hetong07 commented Mar 7, 2021

Description

When ssh to a windows machine, the Detect() will return powershell.exe rather than powershell. It is due to the fact that the os.getenv() returns the absolute path to powershell rather then an empty string, which causes this issue.

fmt.Printf("%v\n",os.Getenv("SHELL"))
c:\windows\system32\windowspowershell\v1.0\powershell.exe

Related issue(s)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant