Skip to content

Commit

Permalink
Revert terminal-main.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
thegecko committed Mar 20, 2023
1 parent 8a64ece commit 9fbc668
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/plugin-ext/src/main/browser/terminal-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,20 @@ export class TerminalServiceMainImpl implements TerminalServiceMain, TerminalLin
protected async trackTerminal(terminal: TerminalWidget): Promise<void> {
let name = terminal.title.label;
this.extProxy.$terminalCreated(terminal.id, name);

const updateTitle = () => {
if (name !== terminal.title.label) {
name = terminal.title.label;
this.extProxy.$terminalNameChanged(terminal.id, name);
}
};
terminal.title.changed.connect(updateTitle);
this.toDispose.push(Disposable.create(() => terminal.title.changed.disconnect(updateTitle)));

const updateProcessId = () => terminal.processId.then(
processId => this.extProxy.$terminalOpened(terminal.id, processId, terminal.terminalId, terminal.dimensions.cols, terminal.dimensions.rows),
() => {/* no-op */ }
);

updateProcessId();
terminal.title.changed.connect(updateTitle);
this.toDispose.push(Disposable.create(() => terminal.title.changed.disconnect(updateTitle)));
this.toDispose.push(terminal.onDidOpen(() => updateProcessId()));
this.toDispose.push(terminal.onTerminalDidClose(term => this.extProxy.$terminalClosed(term.id, term.exitStatus)));
this.toDispose.push(terminal.onSizeChanged(({ cols, rows }) => {
Expand Down

0 comments on commit 9fbc668

Please sign in to comment.