dsh-terminal-button: Reusing the official terminal at the bottom of DSH and supplementing the desktop entry

Introduction

Starting from version 0.2.1, DeepSeek Harness (DSH) includes an official right-sidebar terminal in the client: PTY, transport, session list, themes, and xterm are all provided by @deepseek-ai/dsh-client-ui-sidebar-terminal. If you prefer using the terminal as a full-width row below the composer, or want the “Open Terminal” entries in the tray and title bar to land in the same area, along with copy/paste shortcuts and the dsh command within the shell, setting up a separate terminal stack is redundant and hard to maintain. The following introduces the community plugin dsh-terminal-button (Maintainer: whiteS18, Category: Client): it does not implement a second set of PTY/WebSocket/xterm, but rather renders the official terminal at the bottom of the conversation column, adding desktop entries and a CLI shim that the official version does not cover.

What is this

dsh-terminal-button is a client plugin for DeepSeek Harness, described as “Embedded terminal plugin for DeepSeek Harness”. The current npm package version is 0.4.4, licensed under MIT. The source code is available at GitHub: whiteS18/dsh-terminal-button, and the directory page is at SkillHub: dsh-terminal-button.

Since version 0.4.0, the plugin’s positioning is an “Official terminal extension”: it lazy-loads the TerminalBody from the official package chunk lib/client.terminal.js at the conversation.composer.dock location, with data coming from the official client service webTerminals. The plugin itself does not contain PTY, WebSocket, xterm, or session recovery logic.

Core Features

Bottom Panel

The panel layout remains consistent with the 0.3.x era: it occupies a dedicated row at the bottom of the composer, spans the same width as the main interface, and the height can be adjusted by dragging the top edge. The header displays the conversation cwd, and the status line is retained at the bottom (Connecting / Running / Exited / Error, path, “Restart Terminal”). If the official terminal is recycled or destroyed by the Host (restart, session unload, idle recycling), opening the panel again will automatically create a new terminal and notify via the status line, without needing to manually click “New Terminal”.

Closing the panel only detaches it: the official view and Host process are retained and recycled according to the official “unattached terminal” timeout (default 2 hours); re-attaching will receive a full-screen snapshot. The plugin bridges via a window hold to prevent the bottom terminal (which has no sidebar Tab) from being incorrectly released by the sidebar toggle.

Copy and Paste Shortcuts

Inside the bottom panel:

  • Ctrl+Shift+C: Copy selection
  • Ctrl+Shift+V: Paste; on Windows/Linux, Ctrl+V also works for pasting
  • Ctrl+C remains SIGINT; on macOS, Cmd+C / Cmd+V retain native behavior

The implementation forwards browser copy and official paste events to the official xterm; selection and input are still handled by the official renderer (0.4.4 restores the shortcuts lost during the 0.4.0 refactoring via a DOM bridge).

Desktop “Open Terminal” Entry

The “Open Terminal” entries in the tray, settings page, and title bar patch desktopRuntime.openTerminal on the Host side to redirect to the bottom panel (via SSE /dsh-terminal/events notifying the frontend). If System Popup is selected in the plugin settings, the native behavior is allowed, opening a system terminal window directly.

dsh Command Shim

When the desktop version lacks a standalone dsh executable, the official terminal usually only passes through DSH_SESSION_ID when starting subprocesses. The plugin patches ctx.subprocess.spawnTerminal to prepend dsh.cmd / dsh from a temporary directory to the PATH—effective for both the official right-sidebar terminal and the bottom panel, and it does not re-inject any DSH_* variables into the shell.

Display Position and New Session Interface

In Plugins → Plugin List → This Plugin Details → “Terminal Display Position”, you can choose:

  1. Bottom Panel (Default)
  2. System Popup

The old sidebar configuration will be automatically normalized to the bottom panel. The right-sidebar terminal remains provided by the official version.

When entering the “New Session” / empty session (hero) interface, the bottom panel collapses and will not automatically pop back up after sending the first message; it will only re-attach when the terminal icon is explicitly clicked (listening for data-content-phase="hero").

Capabilities Still Handled by the Official Version

Theme following, OSC palettes, cursor contrast, mouse selection, font and size, Shell selection (including preferredShell), terminal count limits, and cross-refresh recovery all use the official terminal implementation; this plugin does not re-implement them.

Compatibility and Dependencies

  • Requires DSH Desktop 0.2.1-rc.2 or higher.
  • The official terminal plugin @deepseek-ai/dsh-client-ui-sidebar-terminal must be enabled in the Profile bundle (dsh-web-app injects it by default).
  • The client loads the rendering component via the official modules.importChunk() and reuses the view via webTerminals; the Host side requires webServer and subprocess services. If DSH changes the above contracts, the plugin needs to adapt accordingly.

Installation and Activation

Desktop profile installation (command from the project README):

dsh plugin --profile desktop add dsh-terminal-button

Local development directory installation:

dsh plugin --profile desktop add /absolute/path/to/dsh-terminal-button

Startup sequence determines whether a restart is needed: The plugin bundle is composed when the DSH process starts, and the installation command only modifies the profile file on disk.

  1. Install first → Then start: Takes effect immediately.
  2. Start first → Then install: After installation, you must fully quit and restart DSH Desktop.

If only client.js (the client half) is modified, client-hmr can hot-update or refresh the window; modifying index.js (the Host half) requires restarting DSH Desktop.

After installation, use the Host health check to confirm the Host half is loaded (replace <port> with your local DSH port):

curl http://127.0.0.1:<port>/dsh-terminal/health

It should normally return {"ok":true}.

Typical Usage

  1. Install via the command above and ensure DSH Desktop has been restarted (if DSH was running during installation).
  2. Use the terminal icon in the conversation composer area or the desktop “Open Terminal” entry; the terminal appears in the bottom panel (unless set to System Popup).
  3. Use Ctrl+Shift+C / Ctrl+Shift+V (or Ctrl+V on Linux/Windows) within the panel for copy/paste; use “Restart Terminal” in the status line if needed.
  4. Call dsh directly in the terminal shell (PATH is injected by the plugin shim).
  5. To use an external system terminal, change “Terminal Display Position” to System Popup in the plugin details.

For debugging, open DSH Developer Tools (title bar wrench or Ctrl+Shift+I) and check window.__DSH_TRANSPORT__, window.__DSH_BOOT__, etc., in the Console; if the bottom panel fails to load, the reason will be displayed inside the panel (e.g., official chunk unavailable or webTerminals service missing).

Use Cases and Notes

Suitable for: Developers already using DSH Desktop who want a full-width terminal below the composer, unified desktop “Open Terminal” behavior, and use of the dsh CLI within the shell.

Notes:

  • The plugin’s Host half runs with the current DSH process privileges; please read the source code and LICENSE before installing to assess the trust boundary yourself.
  • The community directory SkillHub has no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem emphasizes “everything is a plugin”, and this plugin is an extension of the official terminal, not a replacement for the entire terminal stack.
  • 0.4.x uses the “Official terminal extension” architecture; 0.3.x was the old implementation with its own terminal. See the repository CHANGELOG.md for the upgrade path and changes.

Conclusion

dsh-terminal-button connects the official @deepseek-ai/dsh-client-ui-sidebar-terminal to the bottom of the composer, and supplements desktop entry redirection, copy/paste shortcuts, and the dsh PATH shim, avoiding the redundant maintenance of a second terminal stack. The installation command is dsh plugin --profile desktop add dsh-terminal-button; for details and issues, see GitHub, and for the directory index, see the SkillHub plugin page.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye