Start Comfy without a visible command prompt on the desktop.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-01 07:07:41 -05:00
co-authored by Cursor
parent 66f2db3738
commit fa32fb0a8e
2 changed files with 86 additions and 23 deletions
+12 -6
View File
@@ -226,12 +226,18 @@ async function processRunning() {
function spawnLaunchCommand(command: string) {
log('spawn', { command: command.slice(0, 180) })
const child = spawn(command, {
shell: true,
detached: true,
stdio: 'ignore',
windowsHide: true
})
const win = process.platform === 'win32'
const exe = win
? command.match(/start\s+""\s+"([^"]+)"/i)?.[1] || command.match(/^"([^"]+\.exe)"\s*$/i)?.[1]
: ''
const child = exe
? spawn(exe, [], { detached: true, stdio: 'ignore', windowsHide: true })
: spawn(command, {
shell: true,
detached: !win,
stdio: 'ignore',
windowsHide: true
})
child.unref()
}