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$SHELLor/bin/bash. - Uses
xterm.jsto 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 → Pluginswhere you can configure theme, font size, max height, opacity, initial collapse, shell, and working directory. - Provides a pure streaming view fallback when
xterm.jsfails 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¶
-
Use
Ctrl+`in DSH Web to toggle the terminal panel. -
Open
Settings → Plugins → Terminalto adjust theme, font size, max height, opacity, initial collapse, shell, and working directory. -
Theme, opacity, font size, and max height are applied immediately; shell and working directory are applied when the terminal is opened next time.
-
Windows defaults to using
powershell.exe. For Command Prompt, you can set the shell tocmd.exewithshellArgs: []:
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
dshprocess; check the source code and license before installing. - Terminal sessions are
process-localand are not retained after the harness restarts. - WebSocket routes bind to
loopbackjust like the Web GUI. - Windows requires the Windows-built
node-pty(conpty/winpty). - The first render of
xterm.jsrequires access to thejsDelivrCDN; 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.