mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-12-01 03:10:22 +08:00
fix: 二次 Apply 不再误报 #26/#27,重启等到会话树落地再进页面
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
76d86fafb1
commit
921b333a5b
11 files changed
+254
-432
No files matched your search
+2
-5
@@ -1,4 +1,3 @@
|
||||
// Spawned by /dsh-purge/restart: wait until the old web port is free, then relaunch.
|
||||
import net from "node:net";
|
||||
import { spawn } from "node:child_process";
|
||||
import { envForDetachedSpawn } from "./core.js";
|
||||
@@ -37,8 +36,7 @@ async function waitFree() {
|
||||
const ok = await waitFree();
|
||||
if (!ok) process.exit(1);
|
||||
|
||||
// On Windows, detached without a hidden console allocates a visible conhost.
|
||||
// Always force windowsHide + never shell (dsh.cmd → cmd.exe flash).
|
||||
// detached + windowsHide;shell:false 避免再走 dsh.cmd / cmd.exe。
|
||||
const child = spawn(info.execPath, info.argv, {
|
||||
detached: true,
|
||||
stdio: "ignore",
|
||||
@@ -49,7 +47,6 @@ const child = spawn(info.execPath, info.argv, {
|
||||
});
|
||||
child.on("error", () => process.exit(1));
|
||||
child.unref();
|
||||
// Brief linger so the replacement is not torn down with this helper's process
|
||||
// group on Windows before it detaches.
|
||||
// 等子进程脱离 job,避免 helper 退出时带走新进程。
|
||||
await new Promise((r) => setTimeout(r, 400));
|
||||
process.exit(0);
|
||||
Reference in new issue
Block a user