tianxingdao/dsh-shell-switch ↗★ 0

dsh-shell-switch

Choose which local shell runs DSH bash commands (e.g. Niubash, Git Bash, MSYS2) and add a Shell selector page to Settings. 适合Windows等平台下,需要自由切换Git Bash、MSYS2等不同终端执行命令的用户。

Package
dsh-shell-switch
Compatibility
Unverified
Version
0.1.0
License
MIT
Last updated
Oct 26, 2026

Other repositories with this package name

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:tianxingdao/dsh-shell-switch

使用

bash 工具

bash: {
  command:  "git status --short && npm test",
  workdir:  "",   // 可选,默认会话工作目录
  timeoutMs: 120000          // 可选,受配置上限约束
}
  • 每次调用都是全新 shell,cd / 变量 / 函数不跨调用保留;
  • 结果末尾是机器可读标记:[exit code: N]、[killed by signal] 或 [timeout after N ms];
  • 输出超限会截断并提示,完整流在 spill 文件里;
  • 与官方 bash 工具一样支持 run_in_background(配合 job_output / job_kill)。

设置 → Shell 选择器

  • 下拉框分两组:可用于 bash(可选择)与 已检测到,但不是 bash 方言(WSL bash、PowerShell、cmd、Niubash 的 winuxsh.exe,禁用并标注原因);
  • 每个 bash 显示版本(如 5.3.0)与完整路径;
  • 卡片显示当前生效 shell、已保存选择、回退配置、沙箱模式;
  • 保存:写入 %DSH_HOME%\shell-switch.json,下一条命令生效;
  • 恢复默认:清除选择,回落到插件配置的 shell / shellPath / 自动检测;
  • 重新扫描:忽略 15 秒缓存重新检测(装了新 shell 后点一下)。

隐藏 pwsh(Windows)

本插件启用期间,Windows 下每个 Agent 的工具列表都会去掉 pwsh。这不是改组合、也不是卸载官方插件,而是在 Agent 作用域上加一条 deny 过滤,随插件卸载释放。

  • 现存与新建 Agent 都生效,下一条模型请求即可看到新工具列表;
  • 想恢复:停用或卸载本插件。

配置

profile patch 中的 shell-switch 行:

- id: shell-switch
  name: dsh-shell-switch
  config:
    shell: auto
字段默认说明
shellauto预设 shell id:niubash、git-bash、msys2、cygwin、bash、wsl 等;auto 取第一个 bash 兼容项
shellPath空显式可执行文件路径,优先于 shell
timeoutMs120000前台命令默认超时
maxTimeoutMs600000单次 timeoutMs 上限
maxOutputBytes64000单流输出内存上限,超出转存 spill 文件
maxSpillBytes67108864spill 文件上限
graceMs3000终止到强杀的宽限期

选择优先级:设置页保存的路径 → shellPath → shell → 自动检测。

%DSH_HOME%\shell-switch.json(设置页保存的值):

{
  "shell": {
    "path": "",
    "at": "2026-01-01T00:00:00.000Z"
  }
}