Skip to content

Commit 77d20e4

Browse files
committed
fix: use spawn to open browser process
1 parent d719b3d commit 77d20e4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/cli/operations/dev/web-ui/run-web-ui.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ExecLogger } from '../../../logging';
22
import { findAvailablePort } from '../server';
33
import { WEB_UI_DEFAULT_PORT } from './constants';
44
import { type WebUIOptions, WebUIServer } from './web-server';
5-
import { exec } from 'child_process';
5+
import { spawn } from 'child_process';
66

77
export interface RunWebUIOptions {
88
/** Options to pass to WebUIServer (minus uiPort, which is resolved automatically) */
@@ -43,7 +43,7 @@ export async function runWebUI(opts: RunWebUIOptions): Promise<void> {
4343
console.log(`\nChat UI: ${chatUrl}`);
4444
console.log(`Press Ctrl+C to stop\n`);
4545
const openCmd = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
46-
exec(`${openCmd} ${chatUrl}`); // eslint-disable-line security/detect-child-process
46+
spawn(openCmd, [chatUrl], { stdio: 'ignore', detached: true }).unref();
4747
},
4848
onLog,
4949
});

0 commit comments

Comments
 (0)