Skip to content

[Fix] Commands stay Running when user closes their terminal - #1363

Draft
zoomote[bot] wants to merge 1 commit into
mainfrom
fix/terminal-close-completion-2lvnwknm9glyx
Draft

[Fix] Commands stay Running when user closes their terminal#1363
zoomote[bot] wants to merge 1 commit into
mainfrom
fix/terminal-close-completion-2lvnwknm9glyx

Conversation

@zoomote

@zoomote zoomote Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

​Created by Roomote. Follow up by mentioning @roomote, in the web UI, or in Discord.

What changed

  • Finalize the attached command with an unknown exit code when its VS Code terminal closes without a shell execution end event.
  • Cancel pending shell-integration startup and prevent a close-versus-activation race from submitting commands to a dead terminal.
  • Add regression coverage for active closure, startup-wait closure, activation races, and normal completion followed by closure.

Why this change was made

VS Code can omit both the shell execution end event and the OSC completion marker when a terminal is disposed. That left Zoo Code commands marked as Running indefinitely and blocked subsequent chat messages.

Closes #1362.

Impact

Closing a VS Code terminal now interrupts its active Zoo Code command, clears the running state, and allows the task to continue. Commands that already completed are not finalized twice.

Related PRs

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/integrations/terminal/Terminal.ts 68.57% 5 Missing and 6 partials ⚠️
src/integrations/terminal/TerminalRegistry.ts 75.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Closing an active terminal leaves command stuck as Running

1 participant