feat: add terminal detachment functionality

implement terminal cleanup when closing tabs or unmounting component

remove unused actionRunner prop across components

delete unused file-watcher utility
This commit is contained in:
KevIsDev
2025-07-01 10:53:09 +01:00
parent a3fa024686
commit 7ce263e0f5
8 changed files with 78 additions and 245 deletions

View File

@@ -50,4 +50,19 @@ export class TerminalStore {
process.resize({ cols, rows });
}
}
async detachTerminal(terminal: ITerminal) {
const terminalIndex = this.#terminals.findIndex((t) => t.terminal === terminal);
if (terminalIndex !== -1) {
const { process } = this.#terminals[terminalIndex];
try {
process.kill();
} catch (error) {
console.warn('Failed to kill terminal process:', error);
}
this.#terminals.splice(terminalIndex, 1);
}
}
}

View File

@@ -147,6 +147,10 @@ export class WorkbenchStore {
this.#terminalStore.attachBoltTerminal(terminal);
}
detachTerminal(terminal: ITerminal) {
this.#terminalStore.detachTerminal(terminal);
}
onTerminalResize(cols: number, rows: number) {
this.#terminalStore.onTerminalResize(cols, rows);
}