Unverified Commit 57fb41b8 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Ensure additional windows are not created on Windows OS (#45022)

parent c50641f7
......@@ -487,6 +487,9 @@ If you cannot make the changes above, but still want to try out\nNext.js v13 wit
return () => cluster.removeListener('exit', callback)
}
let clusterExitUnsub = handleClusterExit()
// x-ref: https://nodejs.org/api/cluster.html#clustersettings
// @ts-expect-error type is incorrect
cluster.settings.windowsHide = true
cluster.settings.stdio = ['ipc', 'pipe', 'pipe']
setupFork()
......
......@@ -18,6 +18,7 @@ function _getProjectIdByGit() {
{
timeout: 1000,
stdio: `pipe`,
windowsHide: true,
}
)
......
......@@ -10,7 +10,9 @@ import { _postPayload } from './post-payload'
import { getRawProjectId } from './project-id'
import { AbortController } from 'next/dist/compiled/@edge-runtime/primitives/abort-controller'
import fs from 'fs'
import spawn from 'next/dist/compiled/cross-spawn'
// Note: cross-spawn is not used here as it causes
// a new command window to appear when we don't want it to
import { spawn } from 'child_process'
// This is the key that stores whether or not telemetry is enabled or disabled.
const TELEMETRY_KEY_ENABLED = 'telemetry.enabled'
......@@ -245,8 +247,10 @@ export class Telemetry {
JSON.stringify(allEvents)
)
spawn('node', [require.resolve('./deteched-flush'), mode, dir], {
spawn(process.execPath, [require.resolve('./deteched-flush'), mode, dir], {
detached: !this.NEXT_TELEMETRY_DEBUG,
windowsHide: true,
shell: false,
...(this.NEXT_TELEMETRY_DEBUG
? {
stdio: 'inherit',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment