Skip to content

Commit

Permalink
Defualt to Bash even if we're in Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
punmechanic committed Feb 23, 2024
1 parent 45289ec commit 9a1ff00
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cli/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ const (
func getShellType() ShellType {
pid := os.Getppid()
parentProc, _ := ps.FindProcess(pid)
normalizedName := strings.ToLower(parentProc.Executable())
name := strings.ToLower(parentProc.Executable())

if strings.Contains(normalizedName, "powershell") || strings.Contains(normalizedName, "pwsh") {
if strings.Contains(name, "bash") || strings.Contains(name, "zsh") || strings.Contains(name, "ash") {
return shellTypeBash
}

if strings.Contains(name, "powershell") || strings.Contains(name, "pwsh") {
return shellTypePowershell
}

Expand Down

0 comments on commit 9a1ff00

Please sign in to comment.