| 1 | diff --git a/lib/windowsConoutConnection.js b/lib/windowsConoutConnection.js |
| 2 | --- a/lib/windowsConoutConnection.js |
| 3 | +++ b/lib/windowsConoutConnection.js |
| 4 | @@ -63,7 +63,11 @@ |
| 5 | conoutPipeName: _conoutPipeName |
| 6 | }; |
| 7 | var scriptPath = __dirname.replace('node_modules.asar', 'node_modules.asar.unpacked'); |
| 8 | - this._worker = new worker_threads_1.Worker((0, path_1.join)(scriptPath, 'worker/conoutSocketWorker.js'), { workerData: workerData }); |
| 9 | + // Node's watch mode reports dependencies through worker messages. |
| 10 | + // Keep the host's watch environment out of this protocol worker. |
| 11 | + var workerEnv = Object.assign({}, process.env); |
| 12 | + delete workerEnv.WATCH_REPORT_DEPENDENCIES; |
| 13 | + this._worker = new worker_threads_1.Worker((0, path_1.join)(scriptPath, 'worker/conoutSocketWorker.js'), { workerData: workerData, env: workerEnv, execArgv: [] }); |
| 14 | this._worker.on('message', function (message) { |
| 15 | switch (message) { |
| 16 | case 1 /* ConoutWorkerMessage.READY */: |
| 17 | diff --git a/lib/windowsPtyAgent.js b/lib/windowsPtyAgent.js |
| 18 | --- a/lib/windowsPtyAgent.js |
| 19 | +++ b/lib/windowsPtyAgent.js |
| 20 | @@ -218,8 +218,14 @@ |
| 21 | return Promise.resolve([]); |
| 22 | } |
| 23 | return new Promise(function (resolve) { |
| 24 | - var agent = (0, child_process_1.fork)(path.join(__dirname, 'conpty_console_list_agent'), [_this._innerPid.toString()]); |
| 25 | + // Node's watch mode sends its own messages over the helper's IPC channel. |
| 26 | + var agentEnv = Object.assign({}, process.env); |
| 27 | + delete agentEnv.WATCH_REPORT_DEPENDENCIES; |
| 28 | + var agent = (0, child_process_1.fork)(path.join(__dirname, 'conpty_console_list_agent'), [_this._innerPid.toString()], { env: agentEnv, execArgv: [] }); |
| 29 | agent.on('message', function (message) { |
| 30 | + if (!Array.isArray(message.consoleProcessList)) { |
| 31 | + return; |
| 32 | + } |
| 33 | clearTimeout(timeout); |
| 34 | resolve(message.consoleProcessList); |
| 35 | }); |