Problem
When a Zoo Code command's VS Code terminal is closed or killed immediately after the command runs, the command remains marked as Running in chat indefinitely. Subsequent user messages are queued because the task continues waiting for terminal completion.
This has occurred repeatedly with different compound Git commands.
Reproduction steps
- Let Zoo Code run a command in a VS Code-backed terminal.
- Close/kill the terminal immediately after it produces output (or immediately after the command visibly returns).
- Observe that the command card in chat continues displaying Running and the task does not proceed.
Expected result
Closing the terminal should finalize the attached command as interrupted/terminated (with an unknown exit code if necessary), clear its running state, and allow the task to continue.
Actual result
The terminal disappears, but the command card remains Running indefinitely and the conversation is suspended.
Relevant logs
One occurrence showed the complete command output, including its final git log output, before the terminal disappeared. A second occurrence produced this extension-host sequence:
[Extension Host] [onDidStartTerminalShellExecution] {command: 'GIT_EDITOR=true GIT_SEQUENCE_EDITOR=true git rebas…one && cat .git/rebase-merge/done || true; exit 0', terminalId: 2}
[Extension Host] [Terminal Process] stream chunk #1 (+77ms, 318 chars)
There is no corresponding onDidEndTerminalShellExecution event after the terminal closes.
An unrelated VS Code warning appeared nearby:
WARN [mainThreadStorage] large extension state detected (extensionId: ZooCodeOrganization.zoo-code, global: true): 1036.4345703125kb.
That warning appears separate from the missing terminal completion transition.
Suspected lifecycle gap
TerminalRegistry.initialize() handles onDidCloseTerminal, but the close handler currently only calls ShellIntegrationManager.zshCleanupTmpDir(terminal.id). It does not finalize an attached terminal.process, clear busy/running, or emit the completion signal that ultimately posts an exited command status to the webview.
If terminal disposal prevents VS Code from emitting onDidEndTerminalShellExecution or delivering the OSC 633 D marker, neither of the existing completion paths can run.
Related issues
This appears to be a residual terminal-disposal lifecycle case rather than an exact duplicate of #800.
Suggested regression coverage
- Close the terminal while a shell execution is active.
- Close it immediately after output arrives but before the end event.
- Close it while waiting for shell integration to initialize.
- Ensure normal completion followed by terminal closure does not emit completion twice.
Version
Observed on the current Zoo Code build in use on 2026-08-24; exact packaged version was not captured.
Problem
When a Zoo Code command's VS Code terminal is closed or killed immediately after the command runs, the command remains marked as Running in chat indefinitely. Subsequent user messages are queued because the task continues waiting for terminal completion.
This has occurred repeatedly with different compound Git commands.
Reproduction steps
Expected result
Closing the terminal should finalize the attached command as interrupted/terminated (with an unknown exit code if necessary), clear its running state, and allow the task to continue.
Actual result
The terminal disappears, but the command card remains Running indefinitely and the conversation is suspended.
Relevant logs
One occurrence showed the complete command output, including its final
git logoutput, before the terminal disappeared. A second occurrence produced this extension-host sequence:There is no corresponding
onDidEndTerminalShellExecutionevent after the terminal closes.An unrelated VS Code warning appeared nearby:
That warning appears separate from the missing terminal completion transition.
Suspected lifecycle gap
TerminalRegistry.initialize()handlesonDidCloseTerminal, but the close handler currently only callsShellIntegrationManager.zshCleanupTmpDir(terminal.id). It does not finalize an attachedterminal.process, clearbusy/running, or emit the completion signal that ultimately posts anexitedcommand status to the webview.If terminal disposal prevents VS Code from emitting
onDidEndTerminalShellExecutionor delivering the OSC 633Dmarker, neither of the existing completion paths can run.Related issues
D-marker self-finalization, but terminal disposal can prevent that marker from being received.This appears to be a residual terminal-disposal lifecycle case rather than an exact duplicate of #800.
Suggested regression coverage
Version
Observed on the current Zoo Code build in use on 2026-08-24; exact packaged version was not captured.