From d631f4bdfb0e958094ccd520a53d8f8e973abc92 Mon Sep 17 00:00:00 2001 From: Izumi Hoshino Date: Thu, 19 Sep 2024 01:09:02 +0900 Subject: [PATCH] Fixed an issue where chia services could not run in the background on macOS --- packages/gui/src/util/chiaEnvironment.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/gui/src/util/chiaEnvironment.js b/packages/gui/src/util/chiaEnvironment.js index 99f57c2bba..48d1a7d6ca 100644 --- a/packages/gui/src/util/chiaEnvironment.js +++ b/packages/gui/src/util/chiaEnvironment.js @@ -90,13 +90,20 @@ const chiaInit = () => { const startChiaDaemon = () => { pyProc = null; + let procOption; + if (process.platform === 'darwin') { + procOption = { + detached: true, + windowsHide: true, + }; + } + const chiaExec = getExecutablePath(PY_CHIA_EXEC); console.info('Running python executable: '); console.info(`Script: ${chiaExec} ${CHIA_START_ARGS.join(' ')}`); try { - const Process = childProcess.spawn; - pyProc = new Process(chiaExec, CHIA_START_ARGS); + pyProc = childProcess.spawn(chiaExec, CHIA_START_ARGS, procOption); } catch (e) { console.error('Running python executable: Error: '); console.error(e);