Explorar el Código

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 <[email protected]>
Eric Wheeler hace 10 meses
padre
commit
902d6d5017
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      src/integrations/terminal/TerminalProcess.ts

+ 4 - 2
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<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()
 			}
 		})
 	}