mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 00:09:30 +01:00
Revert "see if changes fix 1.2.0-beta11 defering conptyNative.connect()"
This reverts commit c5d9064efa.
This commit is contained in:
@@ -49,20 +49,12 @@ export class ChildProcessMonitor extends Disposable {
|
||||
readonly onDidChangeHasChildProcesses = this._onDidChangeHasChildProcesses.event;
|
||||
|
||||
constructor(
|
||||
private _pid: number,
|
||||
private readonly _pid: number,
|
||||
@ILogService private readonly _logService: ILogService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the pid to monitor. This is needed when the pid is not available
|
||||
* immediately after spawn (e.g. node-pty deferred conpty connection).
|
||||
*/
|
||||
setPid(pid: number): void {
|
||||
this._pid = pid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Input was triggered on the process.
|
||||
*/
|
||||
|
||||
@@ -337,20 +337,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
|
||||
this._exitCode = e.exitCode;
|
||||
this._queueProcessExit();
|
||||
}));
|
||||
// node-pty >= 1.2.0-beta.11 defers conptyNative.connect() on Windows, so
|
||||
// ptyProcess.pid may be 0 immediately after spawn. In that case we wait
|
||||
// for the first data event which only fires after the connection completes
|
||||
// and the real pid is available. See microsoft/node-pty#885.
|
||||
if (ptyProcess.pid > 0) {
|
||||
this._sendProcessId(ptyProcess.pid);
|
||||
} else {
|
||||
const dataListener = ptyProcess.onData(() => {
|
||||
dataListener.dispose();
|
||||
this._childProcessMonitor?.setPid(ptyProcess.pid);
|
||||
this._sendProcessId(ptyProcess.pid);
|
||||
});
|
||||
this._register(dataListener);
|
||||
}
|
||||
this._sendProcessId(ptyProcess.pid);
|
||||
this._setupTitlePolling(ptyProcess);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user