向系统提示注入原生 Windows(非 WSL)环境下 PowerShell、字符编码、文件系统与跨平台构建的常见坑点。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:lucifergzsz414/dsh-windows-native
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
I run DeepSeek Harness straight on
Windows — no WSL, just PowerShell. Every WSL & Windows Interop plugin on the
dsh-plugin list assumes you're bridging out
from WSL, so none of them help here. Meanwhile the agent kept doing the same handful
of things wrong: chaining commands with && (PowerShell 5.1 doesn't have it), printing
Chinese text that comes back as mojibake, quietly creating a junction that Windows then
refuses and nobody notices. This plugin just tells it up front so it stops guessing.
It's a system-prompt injection, nothing fancier. Copy-pasted the structure from dsh-wsl-env since that plugin already does the WSL side of the same idea well.
What it tells the agent
- PowerShell has no
&&/||— use;, orA; if ($?) { B } - The console usually isn't UTF-8, so Chinese/non-ASCII output can get mangled even though the actual data is fine — don't trust what you see printed
- Don't feed multi-line non-ASCII text through an inline heredoc or
-c "..."— write it to a file first, then run the file - Python's
subprocess.run(..., text=True)decodes child output using the system locale — GBK on a Chinese Windows install, not UTF-8. A subprocess that ran fine can still blow up withUnicodeDecodeErroron its own output. Passencoding="utf-8", errors="replace"explicitly .batfile contents have to stay ASCII (cmd.exe pre-scans them and can corrupt UTF-8/GBK before anything runs — filenames are fine, the script body isn't)Set-Content/Add-Contentwrite files using the system ANSI codepage by default, not UTF-8 — Chinese text written through either without-Encoding utf8can end up corrupted on disk, not just on screen- Nested quotes in an SSH command forwarded from PowerShell (
ssh host "sudo python3 -c \"...\"") can hang silently for minutes past one level of nesting instead of erroring. Write the command to a local file andscpit over instead - A junction or symlink can fail silently without admin rights / Developer Mode — check it actually exists after creating it, don't just trust the exit code
NUL/CON/PRN/AUX/COM1-9/LPT1-9are reserved in every directory. Discarding output the Unix way with> /dev/nulldoesn't hit a null device on Windows — it can leave a literal, barely-deletable file namednulsitting in the working directory. Use$nullinstead (> $null,| Out-Null)- A file open in Word/Excel/WPS throws a plain PermissionError on write. That's not corruption, don't force-retry the same filename
docker run -v "C:\path\file.yaml:/container/path:ro"can get mis-split — the drive letter's colon looks like another separator. The mount silently fails, the container still reports healthy, and it just runs on defaults.docker execin and check the file before blaming the application code- Native (
.node) npm bindings built here are Windows binaries. Shipping them to a Linux server crashes it at runtime even thoughnpm installand the local build both reported success — check for "PE32+"/"MS Windows" withfilebefore shipping - Killing the outer process (a task runner, a job wrapper) doesn't free the port if the real node/python process underneath is still alive — you end up hitting a stale server and think your fix didn't work. Find the real PID and kill that
- If you need a Scheduled Task to run something invisibly,
-WindowStyle Hiddenstill flashes a console window for a moment. Launch it throughpythonw.exewithCREATE_NO_WINDOWinstead
None of this is theoretical — every line above is something that actually went wrong on this machine at some point.
Install
dsh plugin add dsh-windows-native
Config
when: windows # inject only on native win32 (default), or "always"
order: 15
extraNotes: "" # your own notes, appended after the built-in list
Status
Early, and the list is exactly as long as my own scar tissue — not a survey of every Windows footgun that exists. If you hit something this plugin should have warned you about, open a PR with the actual failure you saw, not a guess at what might go wrong.
Tested against @deepseek-ai/dsh 0.1.1-rc.2 — installed it locally as a file:
dependency, checked dsh --dump-config to confirm it's picked up, then actually asked
the running agent a question and watched the injected text come back in its answer.
链接
同类插件
6Mikao9/dsh-wsl-workspace★ 126
从 Web GUI 添加 WSL 工作区,无需在 WSL 之中再次安装 dsh 以及相关工具,bash 命令与文件读写运行在本机 WSL 发行版内,Windows 文件仍可访问。
XINY11451/dsh-wsl★ 21
将 DSH 的工作范围扩展到 WSL。插件支持了发行版中的文件直接被 DSH 读取、写入、编辑与搜索。面对不同任务需求,AI可根据任务需求自行选择执行一次性命令/自建终端执行多条命令以完成任务。支持在 WSL 终端中键入 dsh 命令调用 DSH(详情在 WSL 终端键入dsh help),深度融合了 WSL 与 DSH。用户新建的所有终端支持与AI可视化协作。
Edge-Echo/dsh-win-toolkit★ 4
面向 DSH agent 的 Windows 原生工具:剪贴板读写、系统通知、hosts 文件查看与网络诊断,均返回结构化数据(带 UI 卡片),底层为防注入的 PowerShell。
Han-1413141/dsh-wsl-native★ 4
在同一个 Windows 窗口中使用 Windows 与原生 Linux DSH 会话,支持 WSL 环境切换和双向系统操作。
stallenlu/dsh-wsl-suite★ 4
为 DeepSeek Harness 增加 WSL 工作区:侧栏 W 按钮列出发行版并把 Linux 目录注册为宿主工作区(以 UNC 路径表示),WSL 会话的侧栏终端在发行版内打开真实 Linux pty。发行版内常驻一个零依赖 agent,通过 JSON-lines 管道响应文件、shell 与搜索请求,空闲时没有轮询计时器触碰发行版,/mnt 盘符对工具与终端保持可达(但无法注册为工作区:宿主用 realpath 规范化工作区路径,而 Windows 解析不了 drvfs);grep 与 glob 在发行版内调用自带的 ripgrep。附带 wsl-standard 等 WSL 孪生预设,替换 shell 与 fs 工具。本插件是 6Mikao9/dsh-wsl-workspace 的重写版,不能与上游同装——两者都在侧栏挂同一个 W 入口、发布同名的 wsl-<mode> 预设,并各自包装宿主的单槽终端 provider。
173787247/dsh-wsl-env★ 3
向 system prompt 注入 WSL 发行版、Linux 路径映射、/mnt/c 的 CRLF 与 git 注意点,以及 NODE_USE_ENV_PROXY。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。