diff options
| author | Fuad <[email protected]> | 2025-04-27 07:25:33 +0300 |
|---|---|---|
| committer | Kujtim Hoxha <[email protected]> | 2025-04-27 13:46:59 +0200 |
| commit | 8a4d4152ce450fda5c7b2894ed59f615ca8f09da (patch) | |
| tree | 0f124d1af415eb7f5738a178e380b855b3e3b014 /internal/llm | |
| parent | f12386e558e1479672be299e4e006f7d67aa233e (diff) | |
| download | opencode-8a4d4152ce450fda5c7b2894ed59f615ca8f09da.tar.gz opencode-8a4d4152ce450fda5c7b2894ed59f615ca8f09da.zip | |
use workingDir if shellInstance is nil otherwise use cwd if shellInstance is not nil
Diffstat (limited to 'internal/llm')
| -rw-r--r-- | internal/llm/tools/shell/shell.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/llm/tools/shell/shell.go b/internal/llm/tools/shell/shell.go index 10fa3779f..5731faec3 100644 --- a/internal/llm/tools/shell/shell.go +++ b/internal/llm/tools/shell/shell.go @@ -47,8 +47,10 @@ func GetPersistentShell(workingDir string) *PersistentShell { shellInstance = newPersistentShell(workingDir) }) - if shellInstance == nil || !shellInstance.isAlive { + if shellInstance == nil { shellInstance = newPersistentShell(workingDir) + } else if !shellInstance.isAlive { + shellInstance = newPersistentShell(shellInstance.cwd) } return shellInstance |
