Introduction

When developing in DSH, you often encounter situations where you need to view shell output, execute interactive commands, or run full-screen terminal programs. If only static text is needed, a standard output panel might suffice; however, if you wish to preserve ANSI colors, cursor movement, and 256-color output, you need a real PTY terminal. dsh-plugin-terminal is a plugin designed for DSH Web for exactly this purpose.

Below are its features, installation methods, and limitations to be aware of.

What is this

dsh-plugin-terminal is a DSH Web plugin that provides a real PTY terminal within a VS Code-style collapsible bottom panel. It consists of host PTY + WebSocket + xterm.js, the plugin owner is mervyn-teo, and the license is MIT.

Core Features

  • Provides a real interactive terminal running the default shell via PTY: Windows defaults to PowerShell, while other environments default to $SHELL or /bin/bash.
  • Uses xterm.js to render ANSI colors, cursor movement, full-screen applications, and 256-color output.
  • Provides a VS Code-style collapsible bottom panel including a header, a draggable header to adjust height, a restart button, and a collapse toggle.
  • Supports toggling the panel with Ctrl + `.
  • Performs a re-flow layout when the panel size changes.
  • Provides a Terminal settings card in Settings → Plugins where you can configure theme, font size, max height, opacity, initial collapse, shell, and working directory.
  • Provides a pure streaming view fallback when xterm.js fails to load.

Installation and Enablement

First, ensure that DSH has mounted the subprocess and webServer services. After installing the plugin, restart dsh web, as host bundles are loaded at startup.

dsh plugin --profile web add github:mervyn-teo/dsh-plugin-terminal

Typical Usage

  1. Use Ctrl + ` in DSH Web to toggle the terminal panel.

  2. Open Settings → Plugins → Terminal to adjust theme, font size, max height, opacity, initial collapse, shell, and working directory.

  3. Theme, opacity, font size, and max height are applied immediately; shell and working directory are applied when the terminal is opened next time.

  4. Windows defaults to using powershell.exe. For Command Prompt, you can set the shell to cmd.exe with shellArgs: []:

shell: cmd.exe
shellArgs: []

Use Cases and Notes

Suitable for DSH users and plugin developers who need to directly manipulate a real shell in DSH Web. Please note before use:

  • The plugin runs with the permissions of the current dsh process; check the source code and license before installing.
  • Terminal sessions are process-local and are not retained after the harness restarts.
  • WebSocket routes bind to loopback just like the Web GUI.
  • Windows requires the Windows-built node-pty (conpty/winpty).
  • The first render of xterm.js requires access to the jsDelivr CDN; the pure streaming view fallback can still be used offline.

Conclusion

The value of dsh-plugin-terminal lies in putting a real PTY terminal into a bottom panel in DSH Web, providing a collapsible panel, terminal rendering, real-time size adjustment, and a terminal settings card. GitHub repository: mervyn-teo/dsh-plugin-terminal.