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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/main.js +22 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.179",
3
+ "version": "2.1.180",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
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
- // Kill cicy-code, all tmux servers, gotty/ttyd, and code-server processes
1381
- // that the cicy-code sidecar may have spawned. best-effort, sync, cross-platform.
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 (and base name in case extension differs)
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
- for (const t of targets) {
1396
- try { execSync(`pkill -f ${t}`, { stdio: "ignore" }); } catch {}
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
- try { execSync(`tmux kill-server`, { stdio: "ignore" }); } catch {}
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}`);