In the typical DSH workflow, clicking on historical messages, switching conversations in the sidebar, or selecting text with a mouse requires moving the cursor back to the input box at the bottom. This extra click disrupts the flow.
dsh-plugin-type-to-compose resolves this issue. It is a client-side plugin that listens for global keystrokes and automatically transfers focus to the input box of the current conversation.
Plugin Information¶
- Plugin Name:
dsh-plugin-type-to-compose - Core Value: Type or paste anywhere within the DSH window to place content directly into the current conversation’s input box—without needing to click the input box first.
- Maintainer:
daoyu1993-lab - Category: Client-side
- License: MIT
Core Features¶
- Global Listening: Listens to document-level
keydownandpasteevents. - Auto-Focus: Detects text input intent and automatically transfers focus from any location to the current conversation’s input box.
- Input and Paste: Supports text input (
a,1,/,中, etc.) and pasting (supports⌘V/Ctrl+V/Shift+Insert). - Rich Media Support: Supports pasting images and files, reusing official paste logic.
- Multi-Panel Adaptation: Supports multi-session panel scenarios, automatically selecting the writable and laid-out panel.
- Key Filtering: The spacebar yields by default (configurable) to avoid conflicts with page scrolling; does not interfere with controls such as terminals, search boxes, modals, or disabled input boxes.
Installation and Activation¶
Execute the following commands in the terminal:
# Local directory (after cloning this repository)
dsh plugin --profile desktop add "link:$PWD"
# Or directly from GitHub
dsh plugin --profile desktop add "github:daoyu1993-lab/dsh-plugin-type-to-compose"
Refresh the page (⌘R) after installation to activate.
Uninstallation¶
dsh plugin --profile desktop remove dsh-plugin-type-to-compose
The plugin itself does not modify any official files; the interface immediately reverts to its original state after uninstallation.
Typical Usage¶
After installation, operate anywhere within the DSH window:
- Scenario 1: After clicking on a historical message, selecting a conversation in the sidebar, or selecting text with the mouse, you can simply start typing or press
⌘Vto continue writing; there is no need to move the mouse back to the bottom input box and click it. - Scenario 2: Type or paste directly anywhere in the DSH window, and the content will land in the current conversation’s input box.
Notes¶
- Dependency Anchor: Relies on the official
[data-composer-input]anchor. If the upstream name changes, the plugin will fail silently. - Platform Limitations: Only effective within the browser/Web interface.
- Spacebar Handling: The spacebar yields by default to prevent page scrolling from becoming a new message.
- Zero Dependencies: Zero dependencies, zero build.
- Non-invasive: Does not modify official files; the interface immediately reverts to its original state after uninstallation.
This plugin aims to reduce interaction interruptions and is suitable for DSH users accustomed to keyboard operations. For more details and source code, please refer to the GitHub Repository.