Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
There was a problem hiding this comment.
Pull request overview
Adds a new keyboardBindings configuration surface so the browser client can intercept specific keydown combos (key + modifiers) and send configured byte sequences directly to the PTY, improving compatibility with TUIs expecting kitty-keyboard-protocol (or other) sequences.
Changes:
- Adds
keyboardBindingsto the config model, default config, config merging, and/api/configwhitelist. - Implements a capture-phase
keydowninterceptor in the browser client to match bindings and sendcharsover WebSocket. - Documents the schema/usage via a new ADR and updates to the config/client specs, plus adds unit tests around merging/loading.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/server/routes.ts | Exposes keyboardBindings via GET /api/config. |
| src/config.ts | Introduces KeyboardBinding, defaults, and merge logic; wires into loadConfig(). |
| src/client/index.ts | Adds capture-phase keydown handler to intercept bindings and send chars to PTY. |
| src/config.test.ts | Adds tests for keyboardBindings load/merge behavior. |
| docs/specs/config.md | Documents keyboardBindings schema and examples. |
| docs/specs/client.md | Documents the client interception approach and config payload shape. |
| docs/adrs/018.client.keyboard-bindings.md | New ADR describing rationale, schema, and approach. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Replace apt-get with apk in release workflow for Alpine compatibility. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
keyboardBindingsconfig array to~/.config/webtty/config.json— each entry maps akey+modscombo to a raw PTY byte sequence (chars)keydownhandler in the browser client that intercepts matching key combos before ghostty-web sees them and sendscharsdirectly to the PTY over WebSocketcharsvalues (e.g."\u001b[13;2u"for Shift+Enter) — verified working with opencode and HelixChanges
Docs
docs/adrs/018.client.keyboard-bindings.md— new ADR covering design rationale, schema decisions, and considered optionsdocs/specs/config.md—keyboardBindingsschema, how-to guide with kitty protocol formula, binding examples, and conversion table from other terminalsdocs/specs/client.md— keyboard bindings section describing the capture-phase interception approachImplementation
src/config.ts—KeyboardBindinginterface,keyboardBindingsfield onConfig,mergeKeyboardBindingshelper,DEFAULT_KEYBOARD_BINDINGS = []src/server/routes.ts—keyboardBindingsadded to/api/configwhitelistsrc/client/index.ts— capture-phasekeydownlistener with set-based mod matchingsrc/config.test.ts— 100% function + line coverage including directmergeKeyboardBindingsunit tests