Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bin/emrgd.cmd
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,10 @@ set PATH=%DIR%;%PREFIX%\git\cmd;%PREFIX%\git\mingw64\bin;%PATH%
set PYTHONPATH=%PREFIX%\source;%PREFIX%\lib;%PYTHONPATH%
set PYTHONDONTWRITEBYTECODE=1
REM R90: python.exe 复制品在 bin/,DLL 在 python-dist/ → loader 找不到 → 用 python-dist 里的 exe(与 DLL 同目录)
set PYEXE=%DIR%\python-dist\python.exe
REM 无窗口 daemon:GUI spawn 此脚本时 python.exe(console 子系统)会新开控制台黑窗;
REM 改优先用 pythonw.exe(GUI 子系统,不开窗口)。日志写 ~/.emrg/emrgd.log
REM (RotatingFileHandler),StreamHandler 仅附加,无控制台不影响日志。
set PYEXE=%DIR%\python-dist\pythonw.exe
if not exist "%PYEXE%" set PYEXE=%DIR%\python-dist\python.exe
if not exist "%PYEXE%" set PYEXE=%DIR%\python-dist\python3.13.exe
"%PYEXE%" -m emrg.server %*
3 changes: 3 additions & 0 deletions emrg/gui/daemon_client.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,6 +121,9 @@ class DaemonClient {
cwd: this.projectDir,
stdio: "ignore", // G68:对照 DEVNULL
detached: true, // 对照 start_new_session=True
// windowsHide: python.exe 是 console 子系统——GUI spawn 时不隐藏会
// 弹一个命令行黑窗(打包模式 emrgd.cmd 已改走 pythonw.exe,这里补源码模式)。
...(process.platform === "win32" ? { windowsHide: true } : {}),
});
child.unref(); // GUI 退出不带走 daemon
this._daemonChild = child; // 暴露 child(集成测试 after 清理用)
Expand Down
1 change: 1 addition & 0 deletions emrg/gui/main.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -155,6 +155,7 @@ vision = false
const child = spawn(python, ["-c", "from emrg.config import ensure_config; ensure_config()"], {
cwd: projectDir,
stdio: "ignore",
...(process.platform === "win32" ? { windowsHide: true } : {}),
});
child.on("exit", () => {
resolve(fs.existsSync(configPath()) ? fs.readFileSync(configPath(), "utf8") : "");
Expand Down
Loading