Introduction¶
Configuring the DSH Web environment often requires directly managing files or executing commands. A native Web configuration may lack these capabilities, forcing developers to repeatedly switch between their local terminal and the browser. The dsh-plugin-file-and-terminal plugin fills this gap directly in the Web interface.
Plugin Overview¶
Maintained by CarrotFish, this is an MIT-licensed open-source component. It injects a “File Management” panel and a “Terminal” panel into DSH Web profiles. After installation, users can browse the file system, upload and download resources, and use the host Bash Shell directly within the page.
Core Features¶
File Management¶
- Browsing and Navigation: Supports browsing directories, entering subdirectories, and returning to the parent directory.
- Upload: Supports uploading a single file in batch, or uploading an entire directory (preserving the original directory structure).
- Download: Supports downloading a single file, or packaging an entire directory as a ZIP for download.
- Symbolic Links: Only follows symbolic links whose targets remain inside the configuration root directory.
- Limits: Directory listings display at most
maxEntriesitems; uploaded directories contain at most 10,000 file or directory entries.
Terminal Panel¶
- Interactive Bash: Provides an interactive PTY on the host and uses xterm.js to render terminal content.
- Session Persistence: The panel is independent of conversations and Sessions. When switching panels, terminal sessions and screen content are retained, without losing progress.
- Working Directory: The terminal starts from the configured
rootdirectory.
Installation and Enablement¶
Install it using the official CLI:
dsh plugin --profile web add github:CarrotFish/dsh-file-and-terminal
After installation is complete, start or restart the Web profile for the changes to take effect:
dsh web
Configuration¶
Add configuration items to the profile’s cordis.patch.yml. root specifies the root directory for file system access, maxEntries limits the number of listed entries, and maxDownloadBytes and maxUploadBytes limit the total size of a single download and upload.
- insert:
- id: file-and-terminal
name: dsh-plugin-file-and-terminal
config:
root: "~"
maxEntries: 1000
maxDownloadBytes: 67108864
maxUploadBytes: 67108864
By default, both the download and upload limits are 64 MiB. The plugin also supports the terminalBufferBytes, terminalGraceMs, and maxTerminals configuration items.
Ecosystem and Integration¶
If the dsh-better-sidebar plugin is installed, this plugin automatically registers as a sidebar tab. In this case, the sidebar and main panel share file browsing state and the Bash terminal, avoiding starting duplicate processes for the same view.
Security and Considerations¶
- Permission Scope: The plugin can access content inside the configured root directory in the host file system and provides a host Bash terminal. It runs with the permissions of the current DSH process.
- Risk Warning: This plugin should only be enabled in trusted DSH Web deployments.
- Dependency Check: Before installation, check the source code and license to ensure compliance with your deployment requirements.