Skip to content

Commit 9328d38

Browse files
authored
Merge pull request microsoft#185873 from microsoft/tyriar/185256
Prevent ptyhost channel timing out when startupDelay is set
2 parents 77196de + 1dbc950 commit 9328d38

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/vs/platform/terminal/node/ptyHostMain.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ async function startPtyHost() {
4343
delete process.env.VSCODE_STARTUP_DELAY;
4444
delete process.env.VSCODE_LAST_PTY_ID;
4545

46+
// Delay startup if needed, this must occur before RPC is setup to avoid the channel from timing
47+
// out.
48+
if (startupDelay) {
49+
await timeout(startupDelay);
50+
}
51+
4652
// Setup RPC
4753
const _isUtilityProcess = isUtilityProcess(process);
4854
let server: ChildProcessServer<string> | UtilityProcessServer;
@@ -60,10 +66,9 @@ async function startPtyHost() {
6066
const logger = loggerService.createLogger('ptyhost', { name: localize('ptyHost', "Pty Host") });
6167
const logService = new LogService(logger, [new ConsoleLogger()]);
6268

63-
// Log and apply developer config
69+
// Log developer config
6470
if (startupDelay) {
6571
logService.warn(`Pty Host startup is delayed ${startupDelay}ms`);
66-
await timeout(startupDelay);
6772
}
6873
if (simulatedLatency) {
6974
logService.warn(`Pty host is simulating ${simulatedLatency}ms latency`);

0 commit comments

Comments
 (0)