use workingDir if shellInstance is nil otherwise use cwd if shellInstance is not nil
commit8a4d4152ce450fda5c7b2894ed59f615ca8f09da
authorFuad <justfuad@protonmail.com>
dateSun 27 Apr 2025, 07:25 (2 years ago)
parentf12386e
internal/llm/tools/shell/shell.go+3−1
@@ -47,8 +47,10 @@ func GetPersistentShell(workingDir string) *PersistentShell {
4747 shellInstance = newPersistentShell(workingDir)
4848 })
4949
50− if shellInstance == nil || !shellInstance.isAlive {
50+ if shellInstance == nil {
5151 shellInstance = newPersistentShell(workingDir)
52+ } else if !shellInstance.isAlive {
53+ shellInstance = newPersistentShell(shellInstance.cwd)
5254 }
5355
5456 return shellInstance