drscrewdriver/dsh-bash-terminal-ts ↗★ 8

dsh-bash-terminal-ts

DSH plugin: one shell tool that runs commands through PowerShell, Git Bash, MSYS2, or WSL on Windows, plus an embedded terminal for the bottom dock (dsh-better-sidebar's terminal tab) with per-shell activation switches and a default-shell fallback chain.

包名
dsh-bash-terminal-ts
兼容性
待验证
Harness 依赖范围
>=0.1.0-rc.2 <0.3.0-0
Cordis 依赖范围
^4.0.2
版本
0.8.7
许可证
MIT
最近更新
2026年11月16日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add dsh-bash-terminal-ts

使用

用户在 Web UI 设置默认终端:打开设置(齿轮)→ 通用 →「默认终端」下拉,选择 PowerShell / Git Bash / MSYS2 / WSL 之一。改动即时生效并持久化。

模型看到 shell 工具后,执行命令时自动使用你选择的终端(工具不暴露终端参数,模型无法更改你的选择):

  • 默认终端 = Git Bash 时:shell(command: "git status") 走 Git Bash
  • 默认终端 = MSYS2 时:shell(command: "gcc --version") 走 MSYS2(MINGW64 环境,/mingw64/bin 的 gcc、make 可用)
  • 默认终端 = WSL 时:shell(command: "ls -la /mnt/d/workspace") 走 WSL;传 distro: "Ubuntu" 可指定发行版
  • 默认终端 = PowerShell 时:shell(command: "Get-Process node") 走 PowerShell

模型使用示例

  • 一次性命令(默认终端):shell(command: "git status", description: "查看 git 状态")
  • 跨轮保持状态(交互式):terminal(action: "open") → 记下 sessionId → terminal(action: "send", sessionId, input: "cd /d/project\n") → terminal(action: "send", sessionId, input: "npm run dev\n") → terminal(action: "close", sessionId)
  • 中断正在运行的程序:terminal(action: "signal", sessionId, signal: "SIGINT")
  • 查看活动会话:terminal(action: "list")
  • 沙箱拒绝后升级:shell(command: ..., sandbox_permissions: "workspace-write", justification: "...")

配置

Web UI 设置(推荐):设置 → 通用 →「默认终端」。

插件 row 的 config(覆盖默认,作为设置的 composition 基准):

键默认说明
defaultShellpowershell设置未覆盖时的后端
timeoutMs120000默认超时
maxTimeoutMs600000调用方 timeoutMs 上限
pwshPath自动探测固定 pwsh.exe 路径
gitBashPath自动探测固定 git bash.exe 路径
msys2Path自动探测(C:\msys64\usr\bin\bash.exe 优先,msys2.exe 兜底)固定 MSYS2 bash.exe 路径
wslPath自动探测固定 wsl.exe 路径