fix: prevent UI hang when shell integration is unavailable

When shell integration is unavailable, the UI would hang because the process
was never properly released. This change fixes the issue by:
- Emitting a 'completed' event with a descriptive message
- Marking the terminal as not busy
- Clearing the active stream
- Allowing the process to continue

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
This commit is contained in:
Eric Wheeler 2025-04-09 20:05:23 -07:00
parent 0b0c438284
commit 902d6d5017

View file

@ -95,7 +95,6 @@ export interface ExitCodeDetails {
coreDumpPossible?: boolean
}
import { Terminal } from "./Terminal"
import { TerminalRegistry } from "./TerminalRegistry"
export interface TerminalProcessEvents {
line: [line: string]
@ -140,7 +139,10 @@ export class TerminalProcess extends EventEmitter<TerminalProcessEvents> {
this.once("no_shell_integration", () => {
if (this.terminalInfo) {
console.log(`no_shell_integration received for terminal ${this.terminalInfo.id}`)
TerminalRegistry.removeTerminal(this.terminalInfo.id)
this.emit("completed", "<no shell integration>")
this.terminalInfo.busy = false
this.terminalInfo.setActiveStream(undefined)
this.continue()
}
})
}