From ca333ce2dab02b19a751eacdca6eb16a09e62672 Mon Sep 17 00:00:00 2001 From: geekgeekrun Date: Fri, 22 Mar 2024 09:14:18 +0800 Subject: [PATCH] fix stdio is invalid issue on Windows --- .../run-core-of-geek-auto-start-chat-with-boss/daemon-main.mjs | 2 +- .../main/flow/GEEK_AUTO_START_CHAT_WITH_BOSS_DAEMON/index.ts | 2 +- packages/ui/src/main/window/mainWindow.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/run-core-of-geek-auto-start-chat-with-boss/daemon-main.mjs b/packages/run-core-of-geek-auto-start-chat-with-boss/daemon-main.mjs index 8c50203..d2b2293 100644 --- a/packages/run-core-of-geek-auto-start-chat-with-boss/daemon-main.mjs +++ b/packages/run-core-of-geek-auto-start-chat-with-boss/daemon-main.mjs @@ -21,7 +21,7 @@ function runWithDaemon () { 'main.mjs' )], { - stdio: [process.stdin, process.stdout, process.stderr, 'pipe', 'ipc'], + stdio: ['inherit', 'inherit', 'inherit', 'pipe', 'ipc'], env: { ...process.env, MAIN_BOSSGEEKGO_RERUN_INTERVAL: rerunInterval diff --git a/packages/ui/src/main/flow/GEEK_AUTO_START_CHAT_WITH_BOSS_DAEMON/index.ts b/packages/ui/src/main/flow/GEEK_AUTO_START_CHAT_WITH_BOSS_DAEMON/index.ts index 537a56d..0a015b3 100644 --- a/packages/ui/src/main/flow/GEEK_AUTO_START_CHAT_WITH_BOSS_DAEMON/index.ts +++ b/packages/ui/src/main/flow/GEEK_AUTO_START_CHAT_WITH_BOSS_DAEMON/index.ts @@ -13,7 +13,7 @@ const rerunInterval = (() => { })() function runWithDaemon() { const subProcessOfCore = childProcess.spawn(process.argv[0], process.argv.slice(1), { - stdio: [process.stdin, process.stdout, process.stderr, 'pipe', 'ipc'], + stdio: ['inherit', 'inherit', 'inherit', 'pipe', 'ipc'], env: { ...process.env, MAIN_BOSSGEEKGO_UI_RUN_MODE: 'geekAutoStartWithBossMain' diff --git a/packages/ui/src/main/window/mainWindow.ts b/packages/ui/src/main/window/mainWindow.ts index a0f5ae0..624dc29 100644 --- a/packages/ui/src/main/window/mainWindow.ts +++ b/packages/ui/src/main/window/mainWindow.ts @@ -128,7 +128,7 @@ export function createMainWindow(): void { } subProcessOfPuppeteer = childProcess.spawn(process.argv[0], process.argv.slice(1), { env: subProcessEnv, - stdio: [process.stdin, process.stdout, process.stderr, 'pipe', 'ipc'] + stdio: ['inherit', 'inherit', 'inherit', 'pipe', 'ipc'] }) console.log(subProcessOfPuppeteer) return new Promise((resolve, reject) => {