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

Fix Powershell spawned from Command Prompt being mis-detected #4892

Closed
wants to merge 1 commit into from

Conversation

spowelljr
Copy link

Description

Fixes #4891

Issue:

For CI testing Windows in minikube we SSH into a Windows machine, which starts us in Command Prompt. We then run powershell to change the terminal to Powershell. However, within the Powershell terminal the SHELL environment variable is still pointing to Command Prompt (c:\windows\system32\cmd.exe). So when running the exported function shell.Detect here it returns cmd instead of the expected powershell.

If cmd is detected via SHELL environment variable, do the the more in-depth shell detection.

Related issue(s)

#4891

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.

Powershell instance not properly detected when spawned from Command Prompt
1 participant