fix: show nu as shell on Windows

relates to https://github.com/nushell/nushell/issues/2703
This commit is contained in:
Jan De Dobbeleer 2020-11-02 18:43:10 +01:00 committed by Jan De Dobbeleer
parent e798ad0623
commit 898a8f44e1

View file

@ -178,6 +178,13 @@ func (env *environment) getShellName() string {
if err != nil {
return "unknown"
}
if name == "cmd.exe" {
p, _ = p.Parent()
name, err = p.Name()
}
if err != nil {
return "unknown"
}
shell := strings.Replace(name, ".exe", "", 1)
return strings.Trim(shell, " ")
}