Skip to content

Commit

Permalink
Fix PseudoTerminal events (#12146)
Browse files Browse the repository at this point in the history
* Ensure correct pseudoterminal ID

Signed-off-by: thegecko <rob.moran@arm.com>

* Revert terminal-main.ts

---------

Signed-off-by: thegecko <rob.moran@arm.com>
  • Loading branch information
thegecko authored Mar 21, 2023
1 parent fa1db70 commit 1ca8131
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/plugin-ext/src/plugin/terminal-ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,18 @@ export class TerminalServiceExtImpl implements TerminalServiceExt {
terminal.deferredProcessId = new Deferred<number>();
terminal.deferredProcessId.resolve(processId);
}
const pseudoTerminal = this._pseudoTerminals.get(terminalId.toString());

// Switch the pseudoterminal keyed by terminalId to be keyed by terminal ID
const tId = terminalId.toString();
if (this._pseudoTerminals.has(tId)) {
const pseudo = this._pseudoTerminals.get(tId);
if (pseudo) {
this._pseudoTerminals.set(id, pseudo);
}
this._pseudoTerminals.delete(tId);
}

const pseudoTerminal = this._pseudoTerminals.get(id);
if (pseudoTerminal) {
pseudoTerminal.emitOnOpen(cols, rows);
}
Expand Down

0 comments on commit 1ca8131

Please sign in to comment.