Skip to main content

dsh-bash-terminal

13Stars2Forks2Issues0Watchers

DSH Windows Plugin: After the Web UI lets users select their preferred default terminal, shell tools consistently invoke PowerShell, Git Bash, or WSL to execute commands.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
JavaScript
License
MIT
Branch
master
dsh-plugin

Install

cmdweb profile
$ dsh plugin --profile web add dsh-bash-terminal

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin MAXeaglet/dsh-bash-terminal for me: review the repository at https://github.com/MAXeaglet/dsh-bash-terminal first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Line Positioning

DSH's Windows plugin: unify PowerShell, Git Bash, and WSL into a single shell tool, the default terminal is determined by the user in the Web UI settings page, and AI models cannot bypass user selection. Also includes an interactive terminal tool based on PTY.

Core Capabilities

  • Select default terminal (PowerShell / Git Bash / WSL) in Web UI "Settings → General", the shell tool always executes according to this selection
  • Provides the shell tool, which starts a fresh shell for each invocation and follows DSH sandbox policies (restricted mode fail-closed)
  • Provides the terminal tool, which starts a PTY interactive session (cwd / variables / aliases persist across calls), suitable for REPL / ssh / interactive CLI
  • Supports background tasks: long-running commands can be set to run_in_background, obtaining a job id to collect output via job_output or terminate via job_kill
  • When sandbox denies, gives the official [sandbox: file access denied] marker and allows one-time upgrade in the same round using sandbox_permissions + justification

Technical Implementation

  • Language: JavaScript (ESM, main package) + React JSX (client side)
  • Key dependencies: @deepseek-ai/cordis, @deepseek-ai/dsh-tools, @deepseek-ai/dsh-sandbox, node-pty, @deepseek-ai/dsh-shell
  • Architecture pattern: Cordis plugin (inserts tool-bash-terminal node via cordis.patch.yml when profile loads), simultaneously registers host-side (shell + terminal tools) and client-side (settings page "Default Terminal" dropdown)
  • Entry files: lib/index.js (host side), src/client.jsx → dist/client.js (client side)

Use Cases

Windows users who want the model to use Git Bash or WSL instead of PowerShell when running commands in the shell tool; or need to preserve session state for interactive commands (REPL, ssh, long-running processes). Also suitable for those who frequently switch between PowerShell, Git Bash, and WSL and want unified management through a single dropdown.

Prerequisites and Compatibility

DependencyMin VersionDescription
DSH^0.1.0-rc.6Requires cordis / dsh-tools / dsh-sandbox / dh-shell / dsh-settings / dsh-llm / dsh-timeout / client runtime etc.
Node.js>=20package.json#engines.node
OSWindows (win32)Plugin skips registration on non-win32 platforms, lib/index.js:424 returns early
Native modulenode-ptyRequired for interactive terminal tool, called directly on Windows platform
React^18.2.0Only used by client settings panel
PowerShell 7RecommendedPowerShell 5.1 cannot start interactive sessions under ConPTY (one-time commands unaffected)

Installation

dsh plugin --profile web add github:MAXeaglet/dsh-bash-terminal

After initial installation, also run powershell -ExecutionPolicy Bypass -File install.ps1 install to patch the DSH settings UI whitelist (add bash-terminal namespace), otherwise changes in settings page won't take effect. Re-run this script after upgrading DSH.

Configuration Options

ConfigTypeDescriptionDefault
defaultShellstringBackend used when user hasn't overridden in settings page (powershell / gitbash / wsl)powershell
timeoutMsnumberDefault timeout for single invocation (milliseconds)120000
maxTimeoutMsnumberUpper limit for caller's timeoutMs parameter600000
pwshPathstringLock absolute path to pwsh.exe, auto-detect from candidate directories if emptyauto-detect
gitBashPathstringLock absolute path to Git Bash bash.exe, auto-detect from candidate directories (auto-exclude System32 WSL forwarder)auto-detect
wslPathstringLock absolute path to wsl.exe, use %SystemRoot%\System32\wsl.exe if emptyauto-detect

User changes to "Default Terminal" in Web UI settings persist to settings.yaml, taking priority over defaultShell here.

FAQ

Q: Can AI models switch between PowerShell / Git Bash / WSL on their own?

A: No. Terminal selection is changed and persisted in Web UI "Settings → General → Default Terminal" dropdown; the shell tool doesn't expose terminal parameters to the model. Each invocation executes according to current settings, and the model cannot see other options.

Q: Will it conflict with DSH's built-in pwsh tool?

A: No conflict. The plugin specifically avoids the ctx.shell seam, keeping the official sandboxed pwsh tool intact and usable; this plugin registers another tool named shell, an additional multi-terminal entry point.

Q: Can it be installed on macOS or Linux?

A: Yes, it can be installed, but it won't take effect. apply returns early when process.platform !== "win32", so no tools will be registered.

Q: How to enable "upgrade once" in restricted mode?

A: When sandbox denies a command, results carry the [sandbox: file access denied under <mode> mode] marker; the model can retry in the same round with sandbox_permissions (e.g., workspace-write / danger-full-access) + justification, which will go through ctx.approval user approval.

Q: What to do when PowerShell 5.1 interactive terminal reports an error?

A: This is a known ConPTY limitation (0x8009001d). Installing PowerShell 7 resolves it; one-time commands (shell tool) are unaffected.

Q: What to do about sporadic WSL interactive terminal RPC errors?

A: Sporadic 0x8007072c under ConPTY. Continue using one-time commands via shell tool (wsl -e bash -lc ... is stable), or run interactive scenarios directly in Windows Terminal or WSL terminal, or retry.

Q: Settings panel not working after DSH upgrade?

A: DSH upgrades restore the settings UI whitelist. Re-run powershell -ExecutionPolicy Bypass -File install.ps1 install.

Learning Curve

Beginner — regular users only need to select the default terminal once in Web UI settings to use; local development requires understanding PowerShell, junction links, install.ps1 and additional steps.

Known Issues and Limitations

  • Tools only register on Windows; shell and terminal tools won't appear on macOS / Linux after installation
  • PowerShell 5.1 cannot start interactive sessions under ConPTY (error 0x8009001d), requires PowerShell 7; one-time commands work normally
  • WSL interactive mode under ConPTY may trigger WSL service RPC errors (0x8007072c, sporadic); one-time wsl -e bash -lc ... works normally
  • node-pty on Windows doesn't accept named signals: only SIGINT maps to Ctrl+C, other signals (SIGTERM / SIGKILL / SIGTSTP / SIGHUP) degrade to direct session termination
  • WSL background processes may briefly persist in distribution after timeout / interrupt (WSL instances auto-close after last process exits)
  • Git Bash is an msys2 environment, with behavioral differences from WSL's Linux (path mapping, available packages)
  • DSH's Windows ACL sandbox launcher (node-addon-landlock-run-win32-x64) not yet published to npm; local sandbox backend temporarily unavailable
  • DSH settings UI has hardcoded whitelist for third-party settings namespace; must patch with install.ps1 to allow users to write default terminal preference in UI

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/MAXeaglet/dsh-bash-terminal)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory