mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-30 17:00:23 +08:00
fix(desktop): DSH_PROFILE 兜底 + console.warn 污染治理 + --updated 抢前台
- patch #82 main.js 启动顶部补 DSH_PROFILE=desktop 兜底 (双击 exe 从 explorer 继承 env 常缺 → host "cannot determine the boot profile" crash → dsh-purge 没 activate → inject 全断) - lib/desktop.js 全部 console.warn("[dsh-purge] ...") 换成 logInternal() 写内部 log (不污染 host stderr → main.js:3729 fail 回调不再误报假 crash) - lib/restart-desktop.js spawnEnv() 补 DSH_PROFILE + spawn argv 加 --updated (复用 Electron main.js:11256 raiseAfterUpdate 内部 moveTop+focus 强制前台,比外部 PS SetForegroundWindow 可靠) + PS 兜底保留做双保险
This commit is contained in:
1 parent
288c9dbefd
commit
f184ae222d
3 files changed
+138
-17
No files matched your search
+26
@@ -5328,6 +5328,32 @@ const NEW_TOOL_PATCHES = [
|
||||
],
|
||||
markers: ["[dsh-purge] restore missing overlay from bak"],
|
||||
},
|
||||
{
|
||||
id: 82,
|
||||
name: "DESKTOP_SHELL_PROFILE_FALLBACK",
|
||||
layer: "代码",
|
||||
layer_en: "Code",
|
||||
desc: "主进程兜底 DSH_PROFILE=desktop:双击 exe 从 explorer 继承 env 常缺 DSH_PROFILE → host 'cannot determine the boot profile' → dsh-purge 插件没 activate → inject 全断",
|
||||
file: "desktop-shell",
|
||||
surfaces: ["desktop"],
|
||||
optional: true,
|
||||
skipIfMarked: true,
|
||||
replacements: [
|
||||
{
|
||||
pattern:
|
||||
"import { REMOTE_STREAM_MUX_PATH, parseRemoteStreamServerMessage } from \"@deepseek-ai/dsh-api-gateway/stream-protocol\";\n" +
|
||||
"//#region ../../packages/util/home-paths/lib/index.js",
|
||||
replace:
|
||||
"import { REMOTE_STREAM_MUX_PATH, parseRemoteStreamServerMessage } from \"@deepseek-ai/dsh-api-gateway/stream-protocol\";\n" +
|
||||
"// [dsh-purge-82] 双击 exe 从 explorer 继承 env 时常缺 DSH_PROFILE\n" +
|
||||
"// → host 子进程 \"cannot determine the boot profile\" → cordis 不加载\n" +
|
||||
"// → dsh-purge 插件没 activate → __dshPurgeHungPrompt 空 → inject 全断。兜底默认 desktop。\n" +
|
||||
"if (typeof process !== \"undefined\" && process.env && !process.env.DSH_PROFILE) process.env.DSH_PROFILE = \"desktop\";\n" +
|
||||
"//#region ../../packages/util/home-paths/lib/index.js",
|
||||
},
|
||||
],
|
||||
markers: ["[dsh-purge-82] 双击 exe 从 explorer 继承 env 时常缺 DSH_PROFILE"],
|
||||
},
|
||||
];
|
||||
|
||||
export const ALL_PATCHES = [...PATCHES, ...CODE_PATCHES, ...ENGINE_PATCHES, ...NEW_TOOL_PATCHES];
|
||||
|
||||
Reference in new issue
Block a user