概览
dsh-pwsh-direct
源码级技术说明Fixes the DSH Desktop built-in pwsh/shell silent empty-result bug by self-healing the Electron sandbox runner (injects ELECTRON_RUN_AS_NODE=1) on every boot, and provides the pwsh_direct rescue tool that spawns PowerShell directly via node:child_process (pwsh 7 preferred, Windows PowerShell 5.1 fallback), optionally gated by the dsh-powershell-check pitfall checker.收起技术说明
Fixes the DSH Desktop built-in pwsh/shell silent empty-result bug by self-healing the Electron sandbox runner (injects ELECTRON_RUN_AS_NODE=1) on every boot, and provides the pwsh_direct rescue tool that spawns PowerShell directly via node:child_process (pwsh 7 preferred, Windows PowerShell 5.1 fallback), optionally gated by the dsh-powershell-check pitfall checker.
README / ZH
插件文档
目录摘要
Fixes the DSH Desktop built-in pwsh/shell silent empty-result bug by self-healing the Electron sandbox runner (injects ELECTRON_RUN_AS_NODE=1) on every boot, and provides the pwsh_direct rescue tool that spawns PowerShell directly via node:child_process (pwsh 7 preferred, Windows PowerShell 5.1 fallback), optionally gated by the dsh-powershell-check pitfall checker.
dsh.pub 核对固定版本的组合包契约、运行时事实与分发语义;完整 README 请查看源仓库。
在 GitHub 阅读完整 READMELIMITATIONS
已知限制
- `workdir` 默认取 DSH 宿主进程 cwd,**不是**会话工作目录——操作会话文件时请显式传 `workdir`。 - 命令由解析到的 PowerShell 版本解释:回落 5.1 时 `&&`/`||`/`??`/三元 `?:` 等语法不可用(坑位门禁会拦截)。 - 安装副本自愈只覆盖 `C:\Program Files\DSH Desktop` 两个标准路径,非标准安装目录需人工处理(profile 副本不受影响)。 - 自愈是本地文件补丁、非上游修复:DSH Desktop 升级后补丁被冲掉属预期,插件下次启动重新自愈;若上游将来官方修复此 bug,可停用本插件的自愈(`pwsh_direct` 工具可保留作绕路)。 - `pwsh_direct` 命令运行在 DSH 沙箱之外(见"安全与副作用")。
