Passer au contenu principal
O

dsh-keyboard-shortcut

ozongo/dsh-keyboard-shortcut

Adds a Keyboard Shortcuts page to the DSH Settings panel with six rebindable commands — permission-mode cycling, reasoning-effort stepping, a status-page and a task-list shortcut — plus PgUp/PgDn input navigation and an optional composer Enter remap.

Installer

dsh plugin --profile web add github:ozongo/dsh-keyboard-shortcut

README

dsh-keyboard-shortcut

A Keyboard Shortcuts settings page for DeepSeek Harness (DSH), with permission-mode cycling, reasoning-effort stepping, prompt navigation, a status-page shortcut, a task-list toggle, and an optional composer key remap.

中文文档

Overview

dsh-keyboard-shortcut adds one page to DSH's Settings panel and eight shortcuts to the application. The page lists every binding in the running application, lets you change the ones this plugin owns, and carries a switch for remapping the composer's Enter keys.

Every shortcut this plugin adds is an ordinary DSH command. It appears in the shortcut reference, it can be rebound, and it respects the same conflict rules as the built-in commands.

Requirements

RequirementMinimum
DeepSeek Harness0.2.0-rc.2
Node.js (for building from source)22.12.0

This plugin is a client plugin: everything it does happens in the browser half. Its Host half is an empty apply that exists only so DSH serves the browser bundle.

Install

Install into a profile with the DSH plugin command:

dsh plugin --profile <profile> add dsh-keyboard-shortcut

Then restart the profile, or toggle the bundle off and on from Settings → Plugins if the profile reloads live.

What you get

A Keyboard Shortcuts settings page

Settings → Keyboard shortcuts sits directly after General. It has four sections:

  • Plugin shortcuts — the commands this plugin owns, each row editable. Click a row, press a combination, and it saves. Press Escape to cancel.
  • Input navigation — the two page-key shortcuts. These have no command id, so they are listed read-only rather than being rebindable; the reason is under Known limitations.
  • Input optimisation — the composer key switch described below.
  • Application shortcuts — every other registered command, read-only. This is the table that makes a binding conflict comprehensible: when a combination is refused, the row that already owns it is visible right there.

Shortcuts

ShortcutActionPlatforms
Ctrl+QCycle to the next permission modeDesktop Windows, macOS
Ctrl+1Lower the reasoning effort one levelDesktop
Ctrl+2Raise the reasoning effort one levelDesktop
Alt+AOpen the DeepSeek status page in the sidebar browserDesktop
Ctrl+LExpand or collapse the task listDesktop
PgUpGo to the previous inputAll (fixed)
PgDnGo to the next inputAll (fixed)
Ctrl+/Open this plugin's settings pageAll

Ctrl/Cmd+/ is the built-in shortcut reference's default binding. This plugin claims it through the shortcut preference layer, so the reference dialog moves off that key and stays reachable from Settings → General → Edit shortcuts. Turning the switch off restores the original binding.

Input optimisation

When enabled, the composer's three Enter gestures rotate:

StrokeDefaultWith input optimisation
EnterSendInsert a line break
Ctrl+EnterComplementary Queue/SteerSend
Shift+EnterInsert a line breakComplementary Queue/Steer

The switch is off by default.

Configuration

The plugin reads two preferences from browser storage. Both are off-by-default except the shortcut takeover, and both are per device.

KeyDefaultMeaning
optimizeComposerKeysfalseRotate the composer's Enter gestures
takeOverShortcutKeytrueGive Ctrl+/ to this plugin

Preferences live in localStorage under dsh.keyboard-shortcut.v1, beside the key bindings DSH itself stores per device. They are not in the Host settings document, so one machine's choice cannot rewrite another's.

Changing a binding through the settings page writes to the same store DSH's own shortcut editor uses: localStorage on Web, and userData/keybindings.json under Electron.

Permissions

The plugin requests no elevated permissions. It reads the session projections DSH already publishes to the browser and runs the same /permission command the built-in picker runs. It performs no filesystem access and no network requests.

Known limitations

  • Cycle, effort, status-page and task-list shortcuts are Desktop-only by default. DSH reserves Ctrl+Q outside Desktop Windows and macOS, and browsers claim Ctrl+1…Ctrl+8 for tab switching. Alt+A and Ctrl+L are not admitted by the browser allowlist at all — a single non-primary modifier is refused, and both keys are spoken for. All five commands exist on every platform and can be bound by hand; they simply ship unbound where the combination cannot work.
  • The status-page shortcut reuses an open page. The sidebar browser registers itself as a tab type that may appear more than once, so opening it through the sidebar's own API always mints a new tab. The plugin therefore looks for an existing browser tab first and reveals it, expanding the column if it is collapsed. A tab belonging to another session is ignored, because the sidebar only reveals tabs in the session on screen.
  • The task-list toggle clicks the panel header. DSH keeps the collapsed state inside the panel component and exposes no handle, so the shortcut drives the same button a click would. A session with no task list shows nothing to toggle, which the shortcut reports instead of failing.
  • Prompt navigation drives the turn rail. DSH publishes no service for jumping to a turn, so the shortcut activates the rail's own marks. A turn is anchored at its first user message, so "previous input" means "previous turn".
  • The page keys cannot be registered, so they are read raw. PgUp/PgDn are handled through observeFixedInput rather than registerFixed, because DSH's shortcut registry validates every declared code against a closed whitelist — Key*, Digit*, F1–F24, and a fixed set of named keys that does not include the page keys. registerFixed normalizes its bindings up front and throws Unsupported shortcut code: PageUp, so a registration could never succeed. The keyboard layer forwards every keydown to observeFixedInput regardless of registration, so the keys work; they just have no catalog row, and the settings page lists them from a local table as non-rebindable rows.
  • The composer remap is a DOM-layer integration. The composer's keymap is private to dsh-client-ui-conversation; the option rewrites an event's modifier flags rather than reimplementing the send logic. See docs/design.md for the reasoning and the failure mode.
  • The settings navigation glyph is a DOM patch. DSH chooses navigation icons with a hardcoded switch on the section id and offers no icon field on the registration, so the glyph is applied with a CSS mask.
  • Recording loses React state. Rebinding re-registers the command and re-renders the page, like any catalog change.

Development

npm install
npm run build      # writes lib/index.js and lib/client.js
npm test           # build check + unit tests
npm run watch      # rebuild the client half on change

See CONTRIBUTING.md and docs/development.md.

Documentation

License

MIT

Plugins associés