diff --git a/src/helpers/audioActivityDetector.js b/src/helpers/audioActivityDetector.js index 883adc000..84b957f17 100644 --- a/src/helpers/audioActivityDetector.js +++ b/src/helpers/audioActivityDetector.js @@ -262,6 +262,7 @@ class AudioActivityDetector extends EventEmitter { // stdin must be "pipe" — the Windows binary monitors stdin for parent death const child = spawn(binaryPath, ["--exclude-pid", String(process.pid)], { stdio: ["pipe", "pipe", "pipe"], + windowsHide: true, }); this._listenerProcess = child; diff --git a/src/helpers/meetingAecManager.js b/src/helpers/meetingAecManager.js index 081a13b05..d2e6e5890 100644 --- a/src/helpers/meetingAecManager.js +++ b/src/helpers/meetingAecManager.js @@ -78,6 +78,7 @@ class MeetingAecManager { const child = spawn(binaryPath, ["--sample-rate", String(SAMPLE_RATE)], { stdio: ["pipe", "pipe", "pipe"], + windowsHide: true, }); this.process = child; diff --git a/src/helpers/textEditMonitor.js b/src/helpers/textEditMonitor.js index b22458565..349710ca3 100644 --- a/src/helpers/textEditMonitor.js +++ b/src/helpers/textEditMonitor.js @@ -247,6 +247,7 @@ class TextEditMonitor extends EventEmitter { this.process = spawn(command, args, { stdio: ["pipe", "pipe", "pipe"], + windowsHide: true, }); // Send original text via stdin @@ -391,6 +392,7 @@ class TextEditMonitor extends EventEmitter { this.process = spawn(command, [...args, String(targetPid)], { stdio: ["pipe", "pipe", "pipe"], + windowsHide: true, }); this.process.stdin.write(originalText + "\n"); diff --git a/test/helpers/windowsHelperSpawnHide.test.js b/test/helpers/windowsHelperSpawnHide.test.js new file mode 100644 index 000000000..c68a11144 --- /dev/null +++ b/test/helpers/windowsHelperSpawnHide.test.js @@ -0,0 +1,27 @@ +const test = require("node:test"); +const assert = require("node:assert/strict"); +const fs = require("fs"); +const path = require("path"); + +function read(rel) { + return fs.readFileSync(path.join(__dirname, "../..", rel), "utf8"); +} + +function hiddenSpawnCount(src) { + return (src.match(/spawn\([^{}]*\{[^{}]*windowsHide: true/g) || []).length; +} + +test("meeting AEC helper spawn sets windowsHide", () => { + assert.equal(hiddenSpawnCount(read("src/helpers/meetingAecManager.js")), 1); +}); + +test("text edit monitor spawns set windowsHide", () => { + assert.equal(hiddenSpawnCount(read("src/helpers/textEditMonitor.js")), 2); +}); + +test("Windows mic-listener spawn sets windowsHide", () => { + assert.match( + read("src/helpers/audioActivityDetector.js"), + /spawn\(binaryPath, \["--exclude-pid"[^{}]*\{[^{}]*windowsHide: true/ + ); +});