From 902d6d5017ecc8aa18c8b264856bc1781779c8d9 Mon Sep 17 00:00:00 2001 From: Eric Wheeler Date: Wed, 9 Apr 2025 20:05:23 -0700 Subject: [PATCH] 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 --- src/integrations/terminal/TerminalProcess.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/integrations/terminal/TerminalProcess.ts b/src/integrations/terminal/TerminalProcess.ts index cd54ed1ecb..6016279ffb 100644 --- a/src/integrations/terminal/TerminalProcess.ts +++ b/src/integrations/terminal/TerminalProcess.ts @@ -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 { 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", "") + this.terminalInfo.busy = false + this.terminalInfo.setActiveStream(undefined) + this.continue() } }) }