on main help sign in
use workingDir if shellInstance is nil otherwise use cwd if shellInstance is not nil
8a4d415Fuad
internal/llm/tools/shell/shell.go+3−1
@@ -47,8 +47,10 @@ func GetPersistentShell(workingDir string) *PersistentShell {
47 shellInstance = newPersistentShell(workingDir)
47 shellInstance = newPersistentShell(workingDir)
48 })
48 })
49
49
50− if shellInstance == nil || !shellInstance.isAlive {
50+ if shellInstance == nil {
51 shellInstance = newPersistentShell(workingDir)
51 shellInstance = newPersistentShell(workingDir)
52+ } else if !shellInstance.isAlive {
53+ shellInstance = newPersistentShell(shellInstance.cwd)
52 }
54 }
53
55
54 return shellInstance
56 return shellInstance