cicy-desktop 2.1.179 → 2.1.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/main.js +22 -9
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -1377,25 +1377,38 @@ function cleanup() {
|
|
|
1377
1377
|
log.info("[Cleanup] shutting down child services");
|
|
1378
1378
|
try { cicyCodeSidecar.stop(); } catch (e) { /* best-effort */ }
|
|
1379
1379
|
|
|
1380
|
-
//
|
|
1381
|
-
//
|
|
1380
|
+
// Reap leftover NATIVE host helpers from the pre-docker-only era (a stray
|
|
1381
|
+
// cicy-code.exe / ttyd / gotty / code-server). 主人: quitting CiCy Desktop must
|
|
1382
|
+
// NOT touch Docker — in docker-only these all run INSIDE the container, and the
|
|
1383
|
+
// Docker engine (colima VM on mac / WSL distro+dockerd on win) is a separate
|
|
1384
|
+
// background service that survives the app + the container is --restart
|
|
1385
|
+
// unless-stopped. So we ONLY kill exact native host targets, never the engine.
|
|
1382
1386
|
try {
|
|
1383
1387
|
const { execSync } = require("child_process");
|
|
1384
1388
|
const targets = ["cicy-code", "ttyd", "gotty", "code-server"];
|
|
1385
1389
|
|
|
1386
1390
|
if (process.platform === "win32") {
|
|
1387
|
-
// Windows: taskkill /F /IM <name>.exe
|
|
1391
|
+
// Windows: taskkill /F /IM <name>.exe — EXACT image name, no wildcards, so it
|
|
1392
|
+
// can only hit a native cicy-code.exe (retired), never wsl.exe / dockerd /
|
|
1393
|
+
// vmmem / the WSL distro. We never `wsl --terminate/--shutdown` on quit.
|
|
1388
1394
|
for (const t of targets) {
|
|
1389
1395
|
try { execSync(`taskkill /F /IM ${t}.exe`, { stdio: "ignore", windowsHide: true }); } catch {}
|
|
1390
|
-
try { execSync(`taskkill /F /IM ${t}`, { stdio: "ignore", windowsHide: true }); } catch {}
|
|
1391
1396
|
}
|
|
1392
|
-
// Windows has no tmux by default; nothing to do.
|
|
1393
1397
|
} else {
|
|
1394
|
-
// macOS / Linux: pkill matches by command line.
|
|
1395
|
-
|
|
1396
|
-
|
|
1398
|
+
// macOS / Linux: pkill matches by FULL command line. ⚠️ docker-only: cicy-code
|
|
1399
|
+
// / ttyd / gotty / code-server all run INSIDE the container, NOT on the host —
|
|
1400
|
+
// there is normally nothing here to kill. CRITICAL: never `pkill -f cicy-code`
|
|
1401
|
+
// plainly — the colima profile is named `cicy-code`, so the Lima VM hostagent
|
|
1402
|
+
// runs as `limactl ... colima-cicy-code` and a bare match KILLS THE VM on every
|
|
1403
|
+
// quit → next launch sees Docker "down" and re-bootstraps ("重新 install" bug).
|
|
1404
|
+
// Anchor cicy-code to the native --desktop sidecar form (retired) only.
|
|
1405
|
+
const unixPats = ["cicy-code --desktop", "ttyd", "gotty", "code-server"];
|
|
1406
|
+
for (const p of unixPats) {
|
|
1407
|
+
try { execSync(`pkill -f '${p}'`, { stdio: "ignore" }); } catch {}
|
|
1397
1408
|
}
|
|
1398
|
-
|
|
1409
|
+
// Host tmux only (native path, retired); the container's tmux is in its own
|
|
1410
|
+
// namespace and unaffected. (No -f cicy-code match here either.)
|
|
1411
|
+
try { execSync(`pkill -f 'tmux.*cicy'`, { stdio: "ignore" }); } catch {}
|
|
1399
1412
|
}
|
|
1400
1413
|
} catch (e) {
|
|
1401
1414
|
log.warn(`[Cleanup] kill children failed: ${e.message}`);
|