File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -251,18 +251,27 @@ func detectShellParent() string {
251251 multilog .Error ("Failed to get parent process: %s" , errs .JoinMessage (err ))
252252 }
253253
254+ shell := ""
254255 for p != nil && p .Pid != 0 {
255256 name , err := p .Name ()
256257 if err == nil {
257258 if strings .Contains (name , string (filepath .Separator )) {
258259 name = path .Base (name )
259260 }
260261 if supportedShellName (name ) {
261- return name
262+ if runtime .GOOS == "darwin" && name == bash .Name && shell == "" {
263+ // The installer starts State Tool after installing it. The user typically invokes the
264+ // installer using the one-line shell command. The one-liner tends to end up in bash,
265+ // which is often not the user's default on macOS. Try looking one level up for the
266+ // correct shell.
267+ shell = name
268+ } else {
269+ return name
270+ }
262271 }
263272 }
264273 p , _ = p .Parent ()
265274 }
266275
267- return ""
276+ return shell
268277}
You can’t perform that action at this time.
0 commit comments