Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(windows): hide console windows for media and paste helpers

stantheman012804bc3e9049b5
diff --git a/src/helpers/clipboard.js b/src/helpers/clipboard.js
index ea59f83ca..78d3eec26 100644
--- a/src/helpers/clipboard.js
+++ b/src/helpers/clipboard.js
@@ -1085,7 +1085,9 @@ class ClipboardManager {
this.safeLog(`⚡ nircmd paste starting (delay: ${pasteDelay}ms)`);
- const pasteProcess = spawn(nircmdPath, ["sendkeypress", "ctrl+v"]);
+ const pasteProcess = spawn(nircmdPath, ["sendkeypress", "ctrl+v"], {
+ windowsHide: true,
+ });
let errorOutput = "";
@@ -1157,16 +1159,20 @@ class ClipboardManager {
this.safeLog(`🪟 PowerShell paste starting (delay: ${pasteDelay}ms)`);
- const pasteProcess = spawn("powershell.exe", [
- "-NoProfile",
- "-NonInteractive",
- "-WindowStyle",
- "Hidden",
- "-ExecutionPolicy",
- "Bypass",
- "-Command",
- "[void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');[System.Windows.Forms.SendKeys]::SendWait('^v')",
- ]);
+ const pasteProcess = spawn(
+ "powershell.exe",
+ [
+ "-NoProfile",
+ "-NonInteractive",
+ "-WindowStyle",
+ "Hidden",
+ "-ExecutionPolicy",
+ "Bypass",
+ "-Command",
+ "[void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');[System.Windows.Forms.SendKeys]::SendWait('^v')",
+ ],
+ { windowsHide: true }
+ );
let errorOutput = "";
diff --git a/src/helpers/mediaPlayer.js b/src/helpers/mediaPlayer.js
index 63b313614..8eb938e2c 100644
--- a/src/helpers/mediaPlayer.js
+++ b/src/helpers/mediaPlayer.js
@@ -10,7 +10,9 @@ function spawnAsync(cmd, args, { timeout = 3000 } = {}) {
return new Promise((resolve) => {
let child;
try {
- child = spawn(cmd, args, { stdio: ["ignore", "pipe", "pipe"] });
+ // windowsHide avoids a flashing console when helpers invoke nircmd/powershell
+ // on Windows during dictation media pause/resume.
+ child = spawn(cmd, args, { stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
} catch (err) {
resolve({ status: null, stdout: "", stderr: String(err?.message || err) });
return;
@@ -623,12 +625,13 @@ try {
const result = spawnSync(nircmd, ["sendkeypress", "0xB3"], {
stdio: "pipe",
timeout: 3000,
+ windowsHide: true,
});
if (result.status === 0) return true;
}
const result = spawnSync(
- "powershell",
+ "powershell.exe",
[
"-NoProfile",
"-NonInteractive",
@@ -638,6 +641,7 @@ try {
{
stdio: "pipe",
timeout: 5000,
+ windowsHide: true,
}
);
return result.status === 0;
@@ -649,9 +653,9 @@ try {
// Use GSMTC (Windows 10 1809+) — state-aware, targets specific apps
const result = spawnSync(
- "powershell",
+ "powershell.exe",
["-NoProfile", "-NonInteractive", "-Command", this._gsmtcPauseScript()],
- { stdio: "pipe", timeout: 5000 }
+ { stdio: "pipe", timeout: 5000, windowsHide: true }
);
if (result.status === 0) {
@@ -698,9 +702,9 @@ try {
this._pausedWinApps = [];
const result = spawnSync(
- "powershell",
+ "powershell.exe",
["-NoProfile", "-NonInteractive", "-Command", this._gsmtcResumeScript(apps)],
- { stdio: "pipe", timeout: 5000 }
+ { stdio: "pipe", timeout: 5000, windowsHide: true }
);
if (result.status === 0) {
diff --git a/src/utils/process.js b/src/utils/process.js
index 8d5de3cf1..991c7fb9d 100644
--- a/src/utils/process.js
+++ b/src/utils/process.js
@@ -99,7 +99,7 @@ async function runCommand(cmd, args = [], options = {}) {
let timer;
try {
- childProc = spawn(cmd, args, { shell });
+ childProc = spawn(cmd, args, { shell, windowsHide: true });
} catch (error) {
reject(error);
return;