mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
Fix #59635
This commit is contained in:
committed by
garjones
parent
1358e90371
commit
0ce9601287
@@ -90,13 +90,7 @@ export class ExtHostTerminal extends BaseExtHostTerminal implements vscode.Termi
|
||||
pid?: number
|
||||
) {
|
||||
super(proxy, id);
|
||||
this._pidPromise = new Promise<number>(c => {
|
||||
if (pid === RENDERER_NO_PROCESS_ID) {
|
||||
c(undefined);
|
||||
} else {
|
||||
this._pidPromiseComplete = c;
|
||||
}
|
||||
});
|
||||
this._createProcessIdPromise(pid);
|
||||
}
|
||||
|
||||
public create(
|
||||
@@ -138,6 +132,16 @@ export class ExtHostTerminal extends BaseExtHostTerminal implements vscode.Termi
|
||||
this._queueApiRequest(this._proxy.$hide, []);
|
||||
}
|
||||
|
||||
public _createProcessIdPromise(pid?: number): void {
|
||||
this._pidPromise = new Promise<number>(c => {
|
||||
if (pid === RENDERER_NO_PROCESS_ID) {
|
||||
c(undefined);
|
||||
} else {
|
||||
this._pidPromiseComplete = c;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public _setProcessId(processId: number): void {
|
||||
// The event may fire 2 times when the panel is restored
|
||||
if (this._pidPromiseComplete) {
|
||||
@@ -350,6 +354,10 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
|
||||
this._performTerminalIdAction(id, terminal => terminal._setProcessId(processId));
|
||||
}
|
||||
|
||||
public $acceptTerminalProcessLaunching(id: number): void {
|
||||
this._performTerminalIdAction(id, terminal => terminal._createProcessIdPromise());
|
||||
}
|
||||
|
||||
private _performTerminalIdAction(id: number, callback: (terminal: ExtHostTerminal) => void): void {
|
||||
let terminal = this._getTerminalById(id);
|
||||
if (terminal) {
|
||||
|
||||
Reference in New Issue
Block a user