Skip to content

MAXeaglet/dsh-bash-terminal

92Last commit Aug 15, 2026

dsh-bash-terminal DSH plugin

This plugin provides a `shell` tool for one-shot commands and a `terminal` tool for persistent interactive sessions, all running in your chosen backend (PowerShell, Git Bash, or WSL). The backend is set in the DSH Web UI settings, not by the AI model. It integrates with DSH's sandbox, background jobs, and subprocess seams.

How to install the dsh-bash-terminal DSH plugin

dsh plugin --profile web add dsh-bash-terminal   # 自动加进 profile 的 bundles 并应用 patch

Copying does not run this command. Review the repository and version before installing the dsh-bash-terminal DSH plugin.

dsh-bash-terminal DSH plugin data source

dsh-bash-terminal DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-bash-terminal DSH plugin can do

  • Execute one-shot shell commands in PowerShell, Git Bash, or WSL via the `shell` tool.
  • Provide persistent interactive terminal sessions with the `terminal` tool (open/send/signal/close).
  • Allow users to choose the default terminal backend in DSH Web UI settings (persisted via DSH settings system).
  • Support WSL distribution selection for the `shell` tool via the `distro` parameter.
  • Integrate with DSH's sandbox system: fail-closed under restricted mode, sandbox upgrade flow via `sandbox_permissions` and `justification`.
  • Register background tasks into the common `jobs` registry, supporting `run_in_background`, `job_output`, `job_kill`.

Where the dsh-bash-terminal DSH plugin fits

  • Run a quick `git status` or `npm install` in the user's preferred terminal without switching contexts.
  • Open a persistent SSH session inside a WSL distribution and interact with it across multiple turns.
  • Execute a PowerShell script with full output and handle SIGINT via the interactive terminal.
  • Use Git Bash to run POSIX commands (e.g., `ls`, `grep`) on Windows paths without opening a separate terminal.
  • Developers who need to occasionally run commands in WSL for Linux-specific tasks, seamlessly within the DSH conversation.

Who the dsh-bash-terminal DSH plugin is for

  • Windows users who use DSH and want to run commands in their familiar terminal (PowerShell, Git Bash, or WSL) without leaving the chat.
  • Developers who need to execute tasks across different terminal environments and prefer a unified interface.

dsh-bash-terminal DSH plugin limitations

  • Only available on the `win32` platform (Windows).
  • Interactive PowerShell sessions require PowerShell 7; PowerShell 5.1 cannot start a ConPTY session.
  • WSL interactive sessions may occasionally encounter WSL service RPC errors (0x8007072c) in ConPTY; one-shot commands work fine.
  • Git Bash is a msys2 environment, which may differ from WSL or native Linux (path mapping, package availability).
  • The DSH Windows ACL sandbox launcher is not yet published on npm; the sandbox infrastructure is ready but not fully functional until DSH release.

dsh-bash-terminal DSH plugin: from the repository README

Quoted from the MAXeaglet/dsh-bash-terminal README, the upstream source of the dsh-bash-terminal DSH plugin. Copyright remains with the original authors.

> 🌐 [English](README.en.md) · 社区交流:[LINUX DO](https://linux.do) · [GitHub](https://github.com/MAXeaglet/dsh-bash-terminal) ![test](https://github.com/MAXeaglet/dsh-bash-terminal/actions/workflows/test.yml/badge.svg) DSH(DeepSeek Harness)插件:一个 `shell` 工具,在 Windows 上统一执行 **PowerShell / Git Bash / WSL** 三种终端命令。 | 后端 | 实际执行 | 语法 / 路径 | 环境变量 | |------|----------|-------------|----------| | `powershell`(默认) | `pwsh -NoLogo -NoProfile -NonInteractive -Command <cmd>` | PowerShell;`C:\...` | `$env:NAME` | | `gitbash` | Git for Windows `bash -lc <cmd>` | POSIX;`/d/WorkSpace`;PATH 含 `/usr/bin`、`/mingw64/bin` | `$NAME` | | `wsl` | `wsl [-d <distro>] -e bash -lc <cmd>` | Linux;`/mnt/d/...` | `$NAME`(经 WSLENV) | 每次调用都启动全新 shell:**不保留状态**(cwd / 变量 / 别名)——请传 `workdir` 而不是用 `cd`。 ## 设计要点 - **终端由用户决定,AI 无法更改**:Web UI 设置页(设置 → 通用)出现"默认终端"下拉(PowerShell / Git Bash / WSL);`shell` 工具永远只使用该设置,不暴露终端参数给模型。设置通过 DSH settings 系统持久化(settings.yaml)。 - **不占用 `ctx.shell` 能力接缝**:DSH 自带的沙箱化 `pwsh` 工具保持原样可用;本插件的 `shell` 工具是**额外的**多终端入口。 - 通过共享的 `ctx.subprocess` seam 派生进程:进程树终止(Windows `taskkill /T`)、SIGTERM→grace→SIGKILL、输出 spill 文件,与官方 `dsh-tool-bash` / `dsh-tool-pwsh` 行为一致。 - 后台任务注册进通用 `jobs` registry,支持 `ru

Read the full READMERepository license: MIT

dsh-bash-terminal DSH plugin questions

How do I install dsh-bash-terminal?

Run `npm install -g dsh-bash-terminal` then `dsh plugin --profile web add dsh-bash-terminal`. After that, run `powershell -ExecutionPolicy Bypass -File install.ps1 install` to patch the DSH settings whitelist, and restart DSH web. See the README for detailed steps.

Which terminal backends are supported?

PowerShell (default, requires PowerShell 7 for interactive sessions), Git Bash (from Git for Windows), and WSL (any installed Linux distribution). You can choose the default in DSH Web UI settings. The AI model cannot change your choice.

Can I use it on Linux or macOS?

No, the plugin only registers tools on the `win32` platform. It is designed specifically for Windows. On other platforms, the tools will not be available.

Why does my interactive PowerShell session not start?

Interactive PowerShell sessions require PowerShell 7 (pwsh.exe). PowerShell 5.1 cannot start a ConPTY session and will fail with error 0x8009001d. For one-shot commands, PowerShell 5.1 works fine. Install PowerShell 7 to use interactive sessions.

How do I change the default terminal backend?

Go to DSH Web UI settings (gear icon) → General → 'Default Terminal' dropdown. Choose PowerShell, Git Bash, or WSL. The change takes effect immediately and is persisted. The AI model will then use that backend for the `shell` and `terminal` tools.