agent: run ! shell commands in session cwd

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-04-14 19:35:13 +02:00
parent 8b3b6bd281
commit ee82ac7181
1 changed files with 3 additions and 1 deletions

View File

@ -710,7 +710,9 @@ func (s *agentCore) handleCommand(ctx context.Context, input string, handler Eve
if cmdStr == "" {
return true
}
o, err := exec.Command("sh", "-c", cmdStr).CombinedOutput()
cmd := exec.Command("sh", "-c", cmdStr)
cmd.Dir = s.CWD()
o, err := cmd.CombinedOutput()
if err != nil {
handler(infoEvent("error: " + err.Error()))
}