[中文](./README.md) | [English](./README.en.md)
# dsh-esc-stop A [DeepSeek Harness](https://github.com/deepseek-ai/dsh) web GUI plugin: press **`Esc` twice** to stop the current conversation generation — the exact same effect as clicking the GUI stop button. No extra UI, no config, no host code. The browser half captures the `Escape` key and cancels the active turn through the same RPC the GUI stop button uses (`session.cancel`, via the shared `connection` service). The two presses must land within 400ms, preventing accidental triggers. ## Features - Press `Esc` twice (within 400ms) anywhere in a session → the running turn stops. - Equivalent to the built-in stop button: pending inbox work is preserved and resumes later. - Key-repeat safe (`e.repeat` ignored): holding the key or a single press never triggers. - Works per active session: the listener binds to the session that is open. ## Install Add the package to your web profile and register the bundle: ```bash # from your dsh profile directory (e.g. ~/.dsh/profiles/web) dsh plugin --profile web add git+https://github.com/142475/dsh-esc-stop.git ``` Then add `"dsh-esc-stop"` to the `dsh.profile.bundles` array in that profile's `package.json`: ```json { "dsh": { "profile": { "bundles": [ "dsh-esc-stop" ] } } } ``` Restart `dsh web`. Done — no further configuration. ## How it works | Layer | Job | | --- | --- | | `lib/client.js` | Web client half: registers a hidden entry in the session header action slot, installs a `window` `keydown` listener, and calls `connection.api.sessions.cancel({ sessionId })` when `Escape` is pressed twice within 400ms. | | `lib/index.js` | Node half: minimal cordis row so the bundle patch mounts; all behaviour lives in the client half. | The `session.cancel` RPC is the same one the GUI stop button invokes, so behaviour (including inbox preservation and subagent `agent-busy` semantics) is identical. ## Notes - Web profile only (`dsh web`); the tui/headless profiles have their own stop key. - The listener is active while a session is open; there is nothing to stop on the no-session hero screen. - Two `Esc` presses more than 400ms apart reset the timer; a single press never triggers. ## License MIT