DeepSeek Harness Web Plugin: Enter for Newline, Cmd/Ctrl+Enter to Send

Preface

The default keyboard shortcut in DeepSeek Harness (DSH)’s Web mode is Enter to send messages. For developers who need to write multi-line prompts or complex data structures, this reduces input efficiency. DSH’s ecosystem philosophy is “everything is a plugin”, and dsh-composer-modenter is a Web plugin designed for this purpose, allowing you to invert the key behavior of the input box in the Web interface.

What Is This

dsh-composer-modenter is a DSH Web plugin maintained by yonchicy. Through browser-side logic modifications, it changes the default key response of the Web input box: the Enter key is changed from “send” to “newline”, while still preserving the send shortcut and menu selection functionality.

Core Features

The plugin mainly provides the following capabilities:
* Insert newline: Press Enter in the input box to insert a newline character.
* Send message: Press Cmd+Enter on macOS, or Ctrl+Enter on Linux/Windows to send messages.
* Menu selection: When the slash menu is open, pressing Enter still selects the highlighted entry.
* Input method compatibility: Does not interfere with input method composition input (such as Chinese word selection).

Installation and Activation

Install the plugin using the official command:

dsh plugin --profile web add github:yonchicy/dsh-composer-modenter

After installation or update, you need to restart the Web GUI to take effect.

Typical Usage

  1. Open the DSH Web GUI.
  2. Enter multi-line text in the input box, pressing Enter to add a newline for each line.
  3. Press Cmd/Ctrl+Enter to send the message.
  4. If the slash menu is open, pressing Enter will select the currently highlighted command.

How It Works

The plugin logic runs entirely on the browser side. It registers a capture-phase keydown listener on document to intercept and handle key presses in the input box:
1. Modifier key check: Skip events with modifier keys (Shift, Meta, Ctrl, Alt) to ensure Cmd/Ctrl+Enter still sends as expected.
2. Input method check: Skip input method composition events (isComposing or keyCode === 229) to ensure that Chinese and other input methods are unaffected.
3. Target element check: Only process events within the [data-composer-input] element.
4. Menu state check: When the slash menu is open, do not interfere with key presses, allowing Enter to select menu items normally.
5. Newline implementation: In other cases, the plugin disguises the event as Shift+Enter; if the native field is frozen, it uses preventDefault() + insertLineBreak to insert a newline.

Use Cases and Notes

This plugin is suitable for developers accustomed to IDE or code editor shortcuts (Enter for newline), for writing multi-line prompts in the Web interface.

A few points to note:
* The plugin logic runs in the browser and does not depend on the backend.
* The Web GUI must be restarted after installation.
* The plugin follows the MIT open-source license.

Brief Closing

With dsh-composer-modenter, the interaction experience of the Web interface has been improved. If you are looking for a way to optimize the input flow in Web mode, you can check out the community directory or the source repository.

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

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

Xiaoye