MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / GetShellTypeFromShellPath

Function GetShellTypeFromShellPath

pkg/util/shellutil/shellutil.go:465–480  ·  view source on GitHub ↗
(shellPath string)

Source from the content-addressed store, hash-verified

463}
464
465func GetShellTypeFromShellPath(shellPath string) string {
466 shellBase := filepath.Base(shellPath)
467 if strings.Contains(shellBase, "bash") {
468 return ShellType_bash
469 }
470 if strings.Contains(shellBase, "zsh") {
471 return ShellType_zsh
472 }
473 if strings.Contains(shellBase, "fish") {
474 return ShellType_fish
475 }
476 if strings.Contains(shellBase, "pwsh") || strings.Contains(shellBase, "powershell") {
477 return ShellType_pwsh
478 }
479 return ShellType_unknown
480}
481
482var (
483 bashVersionRegexp = regexp.MustCompile(`\bversion\s+(\d+\.\d+)`)

Callers 7

StartWslShellProcFunction · 0.92
StartRemoteShellProcFunction · 0.92
StartRemoteShellJobFunction · 0.92
StartLocalShellProcFunction · 0.92
startNewJobMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected