Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Correctly detect powershell when ssh to windows machine. #4874

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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