Skip to content
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

Correctly detect powershell when ssh to windows machine. #33

Merged
merged 1 commit into from
Mar 6, 2021
Merged

Correctly detect powershell when ssh to windows machine. #33

merged 1 commit into from
Mar 6, 2021

Conversation

hetong07
Copy link

@hetong07 hetong07 commented Mar 5, 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)

@afbjorklund
Copy link

afbjorklund commented Mar 6, 2021

@hetong07 : This would need an upstream issue and PR as well, at https://github.com/docker/machine

Returning the full path sounds normal for $SHELL, for instance /bin/bash. So it's just that DOS .exe

@afbjorklund afbjorklund merged commit fcb2ad5 into machine-drivers:master Mar 6, 2021
@hetong07 hetong07 deleted the shell-windows branch March 7, 2021 04:18
@hetong07 hetong07 restored the shell-windows branch March 7, 2021 04:39
hetong07 added a commit to hetong07/minikube that referenced this pull request Mar 10, 2021
medyagh pushed a commit to hetong07/minikube that referenced this pull request Mar 23, 2021
michaelhenkel pushed a commit to michaelhenkel/minikube that referenced this pull request Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants