
sjh9714/dsh-win32
31最近提交 2026年8月16日
dsh-win32 DSH 插件
dsh-win32 修复了 DSH 在 Windows 上的多个问题,包括 terminal inspection 报错、沙箱内 Git Bash 起不来、前台命令识别、只读模式可写漏洞等。提供两个预设:沙箱用 busybox ash 的变体和全权限用 Git Bash 的变体,并附带 doctor 命令诊断常见问题。
如何安装 dsh-win32 DSH 插件
dsh plugin --profile web add dsh-win32复制不会执行命令。安装 dsh-win32 DSH 插件前请核对仓库和版本。
dsh-win32 DSH 插件数据来源
dsh-win32 DSH 插件快照日期:2026年8月16日
discovered
dsh-win32 DSH 插件能做什么
- 在沙箱模式下提供持久 shell(使用 busybox-w32 ash),是 Windows 上唯一能做到这一点的方案。
- 修复 "terminal inspection is unsupported on platform win32" 错误,通过 CIM 和 taskkill 实现原生 Windows 进程检查器。
- 为只读和工作区写入模式添加了带写入围栏的文件系统后端,阻止未授权写入的同时保留编码支持。
- 支持自动嗅探并解码 GBK/UTF-16 文件,绕过上游的 `FS_NOT_TEXT` 拒绝读取。
- 提供 `doctor` 命令检查已知问题(koffi 损坏、缺少 PowerShell 7、WSL 假 bash 等),并输出机器可读的 JSON 结果。
dsh-win32 DSH 插件适合哪些场景
- 在 Windows 上以沙箱模式运行 DSH agent,同时拥有持久 shell 用于调试和编码。
- 使用最小预设和工作区写入权限,在只允许修改工作区文件的安全边界内编辑文件。
- 从 Claude Code 迁移到 DSH,配合 dsh-movein 插件一键搬移技能和配置。
- 用 `npx dsh-win32 doctor` 诊断并修复 Windows 上 DSH 的常见安装问题。
- 处理包含 GBK 或 UTF-16 编码的旧项目文件,官方 DSH 会拒绝读取这些文件。
dsh-win32 DSH 插件适合谁
- 希望在 Windows 上完整使用 DSH 功能(极简模式、持久 shell、沙箱)的用户。
- 需要在 Windows 上用 DSH 进行编码、调试和自动化的开发者。
dsh-win32 DSH 插件的限制
- Git Bash 预设需要 `danger-full-access` 权限;沙箱内必须使用 busybox 变体,提供 ash 而非 bash(无数组、无 `[[ ]]`)。
- 编辑旧编码文件时会保存为 UTF-8,无法保持原编码。
- PTY 输出的旧代码页在插件层无法解码;node-pty 在 DSH 代码运行前已按 UTF-8 解码。
- `foregroundPgid` 只返回最新附着的进程,对于管道 `a | b | c` 只能杀死最新一段及其子进程。
- `isStdinWaiting` 始终为 false,因为 Windows 缺乏可靠的 stdin 读阻塞探测。
- 基于 DSH 0.1.0-rc.6 开发,需要快速跟进 rc 更新。
dsh-win32 DSH 插件的仓库 README 摘录
以下文字摘自 dsh-win32 DSH 插件的上游仓库 sjh9714/dsh-win32 的 README,版权归原作者,仅作引用。
**在 Windows 上把 DSH 用起来。极简模式、持久 shell、沙箱,全部可用。** [English](./README.en.md) <p> <a href="https://www.npmjs.com/package/dsh-win32"><img src="https://img.shields.io/npm/v/dsh-win32?style=flat-square&label=npm&color=cb3837" alt="npm"></a> <a href="https://github.com/sjh9714/dsh-win32/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/sjh9714/dsh-win32/ci.yml?style=flat-square&label=CI" alt="CI"></a> <a href="https://github.com/sjh9714/dsh-win32/stargazers"><img src="https://img.shields.io/github/stars/sjh9714/dsh-win32?style=flat-square" alt="stars"></a> <img src="https://img.shields.io/badge/platform-win32-0078D4?style=flat-square" alt="win32"> <img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT"> </p>  真机截图。沙箱模式(`Workspace Write`)下,Agent 跑测试看到失败、读源码定位、改掉、再跑一次拿到 `all tests passed`。 ## 三步装好 ```powershell npx dsh-win32 setup --sandboxed ``` 需要 [Git for Windows](https://git-scm.com)(`winget install Git.Git`)。装完启动 `npx @deepseek-ai/dsh web`,然后。 1. 左侧 `Workspaces` 那行点文件夹图标,**先加一个工作区**。不加的话输入框是灰的,打不了字 2. 预设选择器里选 **Minimal (Windows, sandboxed)** 3. 权限徽章保持 *
阅读完整 README仓库许可: MIT
dsh-win32 DSH 插件常见问题
如何在 Windows 上安装 dsh-win32?
最简单的方法是在 PowerShell 中运行 `npx dsh-win32 setup --sandboxed`。这会安装运行时 bundle、沙箱预设并运行体检。需要先安装 Git for Windows(`winget install Git.Git`)。安装完成后,启动 DSH:`npx @deepseek-ai/dsh web`,添加一个工作区,选择 "Minimal (Windows, sandboxed)" 预设,保持权限徽章为 "Workspace Write"。
为什么 DSH 显示 'terminal inspection is unsupported on platform win32' 错误?
这个错误是因为官方 DSH 子进程运行时缺少 Windows 平台上的 `createProcessInspector` 实现。dsh-win32 通过提供原生 Windows 进程检查器修复了这个问题,使用 CIM(WMI)枚举进程树,用 taskkill 处理信号。修复已经集成在插件的预设中,安装 dsh-win32 后无需额外操作。
我能在沙箱模式下使用 Git Bash 吗?
不能。Git Bash 依赖 MSYS/Cygwin 运行时,需要完整的令牌权限,在沙箱模式的受限令牌下无法启动。dsh-win32 提供了一个名为 "Minimal (Windows, sandboxed)" 的预设,使用 busybox-w32 ash(纯 Win32 shell)替代。如果你需要 Git Bash,必须使用 "Minimal (Windows)" 预设并将权限设置为 `danger-full-access`。
如何修复安装 dsh-win32 后的常见问题?
运行 `npx dsh-win32 doctor` 可以检查已知问题,如 koffi 3.1.3/3.1.4 预编译损坏、缺少 PowerShell 7、WSL bash 被误认为 Git Bash 等。doctor 会为每项检查输出 pass/warn/fail/skip 状态。对于可安全自动修复的问题,运行 `npx dsh-win32 fix`。也可以使用 `--json` 参数获取机器可读的输出,用于 CI 或支持流程。
为什么 dsh-win32 编辑文件时会改变编码?
dsh-win32 的自定义文件系统后端(`fs-confined`)在读取文件时自动嗅探编码(支持 GBK 和 UTF-16),但写入时始终保存为 UTF-8。这是为了让 agent 工作区的编码规范化。如果需要保留原始编码,你应该在 agent 编辑文件前手动处理。插件不提供编码往返保留。