MCPcopy
hub / github.com/wavetermdev/waveterm / DetectLocalShellPath

Function DetectLocalShellPath

pkg/util/shellutil/shellutil.go:87–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85)
86
87func DetectLocalShellPath() string {
88 if runtime.GOOS == "windows" {
89 if pwshPath, lpErr := exec.LookPath("pwsh"); lpErr == nil {
90 return pwshPath
91 }
92 if powershellPath, lpErr := exec.LookPath("powershell"); lpErr == nil {
93 return powershellPath
94 }
95 return "powershell.exe"
96 }
97 shellPath := GetMacUserShell()
98 if shellPath == "" {
99 shellPath = os.Getenv("SHELL")
100 }
101 if shellPath == "" {
102 return DefaultShellPath
103 }
104 return shellPath
105}
106
107func GetMacUserShell() string {
108 if runtime.GOOS != "darwin" {

Callers 4

findSshConfigKeywordsFunction · 0.92
StartLocalShellProcFunction · 0.92
getLocalShellPathFunction · 0.92

Calls 1

GetMacUserShellFunction · 0.85

Tested by

no test coverage detected