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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user