Update conpty to 1.25 (#301398)

* Update conpty to 1.25

* see if changes fix 1.2.0-beta11 defering conptyNative.connect()

* Revert "see if changes fix 1.2.0-beta11 defering conptyNative.connect()"

This reverts commit c5d9064efa.

* Reapply "see if changes fix 1.2.0-beta11 defering conptyNative.connect()"

This reverts commit ded49adb14.
This commit is contained in:
Anthony Kim
2026-03-16 18:27:00 -07:00
committed by GitHub
parent a43982e99d
commit 262ba6d42f
7 changed files with 34 additions and 13 deletions

8
package-lock.json generated
View File

@@ -50,7 +50,7 @@
"minimist": "^1.2.8",
"native-is-elevated": "0.9.0",
"native-keymap": "^3.3.5",
"node-pty": "^1.2.0-beta.10",
"node-pty": "^1.2.0-beta.12",
"open": "^10.1.2",
"playwright-core": "1.59.0-alpha-2026-02-20",
"tas-client": "0.3.1",
@@ -15517,9 +15517,9 @@
}
},
"node_modules/node-pty": {
"version": "1.2.0-beta.10",
"resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.2.0-beta.10.tgz",
"integrity": "sha512-vONwSCtAiOVNxeaP/lzDdRw733Q6uB/ELOCFM8DUfKMw6rTFovwFCuvqr9usya7JXV2pfaers3EwuzZfv0QtwA==",
"version": "1.2.0-beta.12",
"resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.2.0-beta.12.tgz",
"integrity": "sha512-uExTCG/4VmSJa4+TjxFwPXv8BfacmfFEBL6JpxCMDghcwqzvD0yTcGmZ1fKOK6HY33tp0CelLblqTECJizc+Yw==",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {

View File

@@ -120,7 +120,7 @@
"minimist": "^1.2.8",
"native-is-elevated": "0.9.0",
"native-keymap": "^3.3.5",
"node-pty": "^1.2.0-beta.10",
"node-pty": "^1.2.0-beta.12",
"open": "^10.1.2",
"playwright-core": "1.59.0-alpha-2026-02-20",
"tas-client": "0.3.1",

View File

@@ -39,7 +39,7 @@
"katex": "^0.16.22",
"kerberos": "2.1.1",
"minimist": "^1.2.8",
"node-pty": "^1.2.0-beta.10",
"node-pty": "^1.2.0-beta.12",
"tas-client": "0.3.1",
"vscode-oniguruma": "1.7.0",
"vscode-regexpp": "^3.1.0",
@@ -1112,9 +1112,9 @@
}
},
"node_modules/node-pty": {
"version": "1.2.0-beta.10",
"resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.2.0-beta.10.tgz",
"integrity": "sha512-vONwSCtAiOVNxeaP/lzDdRw733Q6uB/ELOCFM8DUfKMw6rTFovwFCuvqr9usya7JXV2pfaers3EwuzZfv0QtwA==",
"version": "1.2.0-beta.12",
"resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.2.0-beta.12.tgz",
"integrity": "sha512-uExTCG/4VmSJa4+TjxFwPXv8BfacmfFEBL6JpxCMDghcwqzvD0yTcGmZ1fKOK6HY33tp0CelLblqTECJizc+Yw==",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {

View File

@@ -34,7 +34,7 @@
"katex": "^0.16.22",
"kerberos": "2.1.1",
"minimist": "^1.2.8",
"node-pty": "^1.2.0-beta.10",
"node-pty": "^1.2.0-beta.12",
"tas-client": "0.3.1",
"vscode-oniguruma": "1.7.0",
"vscode-regexpp": "^3.1.0",

View File

@@ -49,12 +49,20 @@ export class ChildProcessMonitor extends Disposable {
readonly onDidChangeHasChildProcesses = this._onDidChangeHasChildProcesses.event;
constructor(
private readonly _pid: number,
private _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.
*/

View File

@@ -337,7 +337,20 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
this._exitCode = e.exitCode;
this._queueProcessExit();
}));
this._sendProcessId(ptyProcess.pid);
// 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._setupTitlePolling(ptyProcess);
}

View File

@@ -476,7 +476,7 @@ const terminalConfiguration: IStringDictionary<IConfigurationPropertySchema> = {
},
[TerminalSettingId.WindowsUseConptyDll]: {
restricted: true,
markdownDescription: localize('terminal.integrated.windowsUseConptyDll', "Whether to use the experimental conpty.dll (v1.23.251008001) shipped with VS Code, instead of the one bundled with Windows."),
markdownDescription: localize('terminal.integrated.windowsUseConptyDll', "Whether to use the experimental conpty.dll (v1.25.260303002) shipped with VS Code, instead of the one bundled with Windows."),
type: 'boolean',
tags: ['preview'],
default: false,