Introduction¶
To insert a screenshot into the DeepSeek Harness (DSH) chat window, you typically need to open a WeChat/QQ screenshot tool, save the file, and then manually upload it. That’s several extra steps, and it becomes inefficient when you need to annotate or capture screenshots frequently. dsh-shot-snap is a client-side plugin that unifies screenshot capture, annotation, and insertion into one workflow: click a button, drag to select a region, annotate, and the screenshot is automatically placed into the current input box’s attachment area — no file is saved, and nothing is uploaded to a third party.
Plugin Overview¶
- Name: dsh-shot-snap
- Maintainer: weichaohao41-oss
- Repository: https://github.com/weichaohao41-oss/dsh-shot-snap
- Directory page: https://www.skillhub.cn/plugins/weichaohao41-oss/dsh-shot-snap
- Category: Client-side
- License: MIT
The plugin follows the standard DSH plugin architecture, split into a Host side (index.js) and a Browser side (client.js). The Host side handles invoking PowerShell for screen capture on Windows desktop, while the Browser side handles the UI and annotation.
Installation & Activation¶
Requirements: DSH desktop version on Windows (≥ 0.2.0). The web version (dsh web) and macOS / Linux are not supported.
Recommended installation via npm:
dsh plugin add dsh-shot-snap
You can also install from GitHub:
dsh plugin add github:weichaohao41-oss/dsh-shot-snap
Local installation (offline):
dsh plugin add link:D:\path\to\shot-snap-plugin
After installation, refresh the window (Ctrl + R), and a screenshot button will appear on the left side of the input box toolbar.
Basic Usage¶
- Click the “Screenshot” button to the left of the input box → the screen freezes and region-selection mode begins
- Click the small triangle to the right of the button → open the menu: toggle capture scope, modify/clear/restore the keyboard shortcut
- Default shortcut: Ctrl + Shift + S (Cmd + Shift + S on macOS)
- Drag the mouse to select a region → pixel dimensions are shown in real time; upon release, an action bar appears
- Toolbar: rectangle / ellipse / arrow / freehand brush / pixelate / text, 5 colors × 3 thickness levels
- Drag an existing annotation → move its position (hold Shift to lock to horizontal or vertical)
- Ctrl + Z → undo the last action (including drags)
- Enter / “Insert into input box” → the selection (with annotations) is cropped to PNG and inserted into the current session’s input box attachment area
- Press Enter with an empty selection → the entire screen is inserted
- Esc / “Cancel” / “Redraw” → cancel this capture / re-select the region
Capture Scope¶
The menu provides two modes, persisted in local localStorage (key: dsh-shot-snap.capture-mode):
- Entire desktop (default): after clicking the button, the window temporarily expands to fill the screen, captures the full desktop, and the window automatically restores after selection. Suitable for capturing other applications such as Edge, WeChat, or an IDE.
- Current window: captures only the DSH window’s own content area, with no flicker and no interference from other windows.
Keyboard Shortcut Configuration¶
The default shortcut is Ctrl + Shift + S (Cmd + Shift + S on macOS). You can modify it in the following ways:
- Click the small triangle to the right of the button → “Modify shortcut” → press the new key combination (Esc to cancel)
- Search for “screenshot” under “Settings → General → Shortcuts”
Shortcuts are managed by the host’s shortcut center. Conflicts are flagged immediately, and changes are written to the host configuration and persisted across restarts. The plugin also includes a fallback listener internally, so even if the native keyboard bridge fails to deliver the key event, the screenshot can still be triggered.
Implementation¶
The plugin consists of two parts:
- Host side (index.js): registers the route
/_dsh/shotsnap/captureonctx.webServer. On Windows desktop, it invokes PowerShell to callSystem.Drawing.CopyFromScreenfor screen capture, supporting parameters such as?desktop=1(full screen),x/y/w/h(current window),/window/expand,/window/restore, etc. The capture result is returned directly as PNG to the local page without being written to disk. The relevant routes listen only on local 127.0.0.1 and include cross-site protection. - Browser side (client.js): injects a screenshot button into
conversation.input.left, mounts a full-screen overlay onshell.overlay, and supports interactions such as annotation, dragging, and undo. Shortcuts are registered viactx.shortcuts.register. Upon insertion, a paste event is synthesized — the selection is cropped into aFileand placed into aDataTransfer, then handed to the host composer’s file entry point, reusing the host’s image validation, max-image-count limit, upload, and draft logic.
Permissions & Privacy¶
- Only requests the permissions strictly necessary for its functionality: the host’s own HTTP route (local 127.0.0.1) + a single local PowerShell screen capture call.
- Does not read the clipboard, does not read other plugins’ DOM, and does not collect conversation content.
- Screenshot bytes exist only in local memory (browser Blob) and a host temporary file (%TEMP%\dsh-shot-
.png, deleted immediately after reading). - Debug log at %TEMP%\dsh-shot-snap.log records only plugin-internal actions (capture duration, selection dimensions, insertion success/failure, etc.). It contains no screen content or conversation content, and is automatically truncated beyond approximately 256 KB.
FAQ¶
- Button not appearing: after installation, you must refresh the window (Ctrl + R). If it still doesn’t appear, check whether
plugin.readyis present in %TEMP%\dsh-shot-snap.log. - Screenshot is black / garbled: some fullscreen exclusive games or protected windows (DRM players) cannot be captured by CopyFromScreen. This is a system-level limitation.
- Insertion fails with “current input box cannot accept attachments”: this usually occurs when a reply is being generated or the session is locked. Wait for the reply to finish and try again.
- Shortcut not responding: go to “Settings → General → Shortcuts,” search for “screenshot,” and confirm there is no conflict with other commands. If it still doesn’t trigger, click the button’s small triangle → “Restore default” to reset.
- Multi-monitor: in full-desktop mode, the entire virtual desktop (the combined area of all monitors) is captured, and you can drag the selection across screens.
- High DPI: the capture declares DPI awareness first and outputs in physical pixels, so images remain sharp even at 150% / 200% scaling.
Development & Debugging¶
Local symlink installation (after modifying code, close and reopen the bundle for a hot reload):
dsh plugin add link:C:\path\to\shot-snap-plugin
For debugging, check %TEMP%\dsh-shot-snap.log — each line is one event (plugin.ready / capture.start / capture.ready / select / annotate.add / insert.dispatch / insert.done / shortcut.saved, etc.).
Uninstall¶
Simply uninstall dsh-shot-snap from the plugin manager. The button, overlay, and shortcut commands will all be removed, and the input box will return to its original state.
Summary¶
dsh-shot-snap unifies screenshot capture, annotation, and insertion within the DSH chat window. It runs entirely locally, does not auto-send, and offers configurable shortcuts. It is well suited for scenarios where you need to frequently capture, annotate, and share screenshots with an AI.
More information and source code: https://github.com/weichaohao41-oss/dsh-shot-snap