Introduction¶
In the development and debugging scenarios of DSH Web GUI, it is often necessary to access the host machine’s Shell environment directly. Regular command-line tools or simple executors cannot meet the needs of interactive debugging. The dsh-term plugin embeds a real terminal panel in the DSH interface, solving this pain point by allowing users to operate the local Shell directly from the browser.
Plugin Overview¶
lijian-ui/dsh-term is a local terminal plugin designed for DSH Web GUI. It uses node-pty to provide real pseudo-terminal (PTY) sessions, rather than simply running preset commands. The plugin implements multi-tab UI rendering with xterm.js and adopts a hot-pluggable architecture, enabling integration without modifying the DSH source code.
Core Features¶
- Real PTY Sessions: Uses the
node-ptylibrary to establish a local Shell and ensures the authenticity of interaction. - Multi-Tab Terminal Panel: Built on
xterm.js, supporting multiple terminal tabs within the same panel. - Layout Integration: The terminal panel docks as a column on the right side, parallel to the file manager panel, maintaining interface consistency.
- Workspace CWD: Each new session starts under the root directory of the current workspace by default.
- Hot-Plug Support: Loads as a Profile Bundle, making the installation and usage process non-invasive to host DSH.
Installation and Enablement¶
Install via the DSH command-line tool:
dsh plugin add @lijian-ui/dsh-term
Alternatively, you can manually edit the configuration file by adding @lijian-ui/dsh-term to the profile’s bundles or dependencies and referencing it in cordis.yml.
Typical Usage¶
After installation, the plugin is in a collapsed (closed) state by default. To enable it, click the “Terminal” button in the launcher of the right-side panel. The terminal panel will automatically dock to the right of the file manager panel and become the rightmost column.
Notes¶
- Current Version Limitations: The current release is Version A and only supports local user terminals. Version B plans to add SSH connections and session-level Shell selection.
- Session Management: Sessions are managed by a host service, which is exposed to the front end via local-loopback-only HTTP routes and an SSE (Server-Sent Events) interface. The front end uses
xterm.jsfor rendering and interaction synchronization. - Permission Requirements: Because it provides a real local Shell, the plugin runs under the permission context of the host process.