Kilo Code Keyboard Patch

Patches Kilo Code's keyboard behavior: Enter starts a new line, Cmd/Ctrl+Enter sends, Cmd/Ctrl+Up and Cmd/Ctrl+Down recall earlier messages, and permission prompts stop hijacking your keystrokes while you are typing.
It also keeps the chat history scrolled to the bottom while you type, stops the mouse cursor macOS hides while you type from highlighting menus and buttons, and makes Escape dismiss the @ mention menu for good.
Each patch release keeps the earlier versions' patterns, so a newer patch still works on an older Kilo Code.
When a Kilo Code update renames the code these patches target, KB Patch works out the new target from the updated build and offers to apply.
What it does
Keyboard patches
| Key |
Before Patched (native Kilo Code) |
After Patched |
Enter |
Send / Approve |
New line (approves when the chat box is empty) |
Cmd/Ctrl+Enter |
Send / Save |
Send / Approve / Save |
Shift+Enter |
New line |
New line (unchanged) |
Escape |
Deny / Abort |
Deny / Abort only when the chat box is empty |
Escape (@ menu open) |
Closes the menu (see below) |
Closes the menu and keeps it closed while you type on |
Shift+Escape |
Deny / Abort |
Deny / Abort (always) |
Up / Down |
Previous / next message at the edges |
Caret movement only |
Cmd/Ctrl+Up / Down |
Caret to start / end |
Previous / next message |
Applies to the chat input, the permission prompt, and the KiloClaw edit/chat panels.
What Escape does once it reaches a permission prompt is Kilo Code's own behavior, and it changed in 7.7.0: earlier releases deny straight away, while 7.7.0 and later open a box for a denial reason, which Escape closes again.
The patch decides whether Escape reaches the prompt at all, not what happens there.
Native Kilo Code recalls a message when a bare Up or Down reaches the start or end of what you typed, which is why holding the key can jump away mid-edit.
Patched, recall moves to Cmd/Ctrl+Up / Down and works from anywhere in the chat box, and stepping forward past the newest message brings your unsent draft back.
Since Kilo Code 7.5.11 an @ mention query may contain spaces, so ordinary prose typed after a mention can bring the menu back on every keystroke, Escape only closes it until the next key, and Enter then replaces your text with the highlighted file.
Patched, Escape dismisses the query you were looking at: the menu stays closed while you type on, and comes back when you edit back into a shorter query or retype the @.
Kilo Code 7.7.0 adopted most of this, so on that release and later the patch covers only the last part, releasing a dismissal once you delete the @ it applied to.
Without that, dismissing an empty @ leaves the menu shut at that spot however many times you retype the @.
Kilo Code releases before 7.5.11 end a query at the first space and need no such patch, which the status view reports as "not needed".
Native Kilo Code lets the chat history jump up a couple of lines while you type or delete in the chat box, then snap back on a later keystroke.
Patched, the history stays scrolled to the bottom while you type.
Hover
macOS hides the mouse cursor while you type, but Kilo Code's webview still treats its last position as pointed at.
When a layout change moves something under that spot, it reacts as if you had moved the mouse there: the @ menu highlights that row instead of the top pick (and Enter then picks it), and a button such as New Worktree shows its tooltip once a growing chat box pushes it there.
Patched, menus and tooltips ignore the hidden cursor until you move the mouse.
Bonus
Optional extras, all off by default.
Enable them from the Settings UI (search "Kilo Code KB Patch") or in your settings.json, then accept the restart KB Patch offers (or run Cmd+Shift+P → Developer: Restart Extension Host).
The editor-title rename is the one extra that needs a window reload instead, and its offer says so.
To turn one off, put it back to its default (or run Restore Originals, which switches every extra off) and restart the same way.
Attach-file button.
Adds a + button to the prompt toolbar that opens Kilo Code's file picker directly, instead of typing @ and choosing "Browse files...".
"kiloCodeKbPatch.addAttachFileButton": true
Relocate the "Open in Tab" icon.
Retitles Kilo Code's editor-title "Open in Tab" action to "Kilo Code: Open" so its icon sorts next to other AI "Open" icons in the editor title bar.
"kiloCodeKbPatch.renameOpenInTab": true
Markdown source of a reply.
Adds a button beside Copy under the agent's reply that shows the reply's markdown source in place, in a monospace block.
Click it again for the rendered view.
This is the text Copy puts on your clipboard, so it is how you tell a table Kilo Code failed to render from one the agent wrote wrong, or read a link's target without hovering it.
"kiloCodeKbPatch.chatRawMarkdownButton": true
Math rendering.
Renders $...$ inline math and \[...\] display math in chat.
Kilo Code already renders $$...$$ and \(...\).
The second setting sizes rendered math in em relative to the text around it, where 1.21 is KaTeX's own size.
"kiloCodeKbPatch.chatMathRendering": true,
"kiloCodeKbPatch.chatMathFontSizeEm": 1.0
Size and font of the agent's replies.
Scales the agent's rendered response text in chat history, and picks a different font for it.
The size is a multiplier on Kilo Code's own Display font-size setting, so that setting keeps working as before.
Headings get a size per level, where Kilo Code renders every level at body size, measured against the response text so the ratios hold at any size.
Anything in a monospace font keeps Kilo Code's own size and font: code blocks, inline code, and file paths.
Reasoning blocks, tool output, and your own messages are left alone entirely.
"kiloCodeKbPatch.chatHistoryFontSizeEm": 1.25,
"kiloCodeKbPatch.chatHistoryFontFamily": "Times"
Install
The extension locates Kilo Code by asking the running editor where it is installed, so native VS Code and its forks need no additional configuration: VSCodium, Cursor, Windsurf, remote servers, and custom --extensions-dir setups.
VS Code
Install from the VS Code Marketplace: Kilo Code KB Patch
VSCodium, Cursor, Windsurf, and other forks
Install from the Open VSX Registry: Kilo Code KB Patch
Get Kilo Code patched
The extension detects an unpatched Kilo Code and offers to apply. Three commands are available from the Command Palette (Cmd+Shift+P → "Kilo Code KB Patch"):
- Apply Patches
- Restore Originals (also switches the bonus settings off)
- Show Status
Restart extensions after applying KB Patch: accept the offer in the notification, or run Cmd+Shift+P → Developer: Restart Extension Host.
A window reload works too, and is what the editor-title rename needs.
A chat opened with Open in Tab shows the change once reopened.
How keystrokes are routed
Kilo Code asks for your input in three ways. The patch rewires only one of them (permission prompts) and decides purely by whether the chat box contains text; spaces and newlines do not count.
KB Patch never moves the keyboard focus. Because Kilo Code moves focus on its own, a choice can take over the keyboard even when you have typed something. When that happens your keys act on the highlighted choice (this is intended, with minimal interference with the native Kilo Code experience).
Permission prompts
Approve or deny a tool or command. The only surface the patch rewires.
- Kilo Code does not shift focus here: it leaves focus in the chat box and intercepts keys with a document-level listener, so the patch can read the chat box content and route accordingly.
The chat box content decides where each key goes:
| Key |
Chat box empty |
Chat box has text |
Enter |
Approve |
New line |
Space |
Approve |
Space |
Cmd/Ctrl+Enter |
Approve |
Approve |
Escape |
Deny |
Dismiss autocomplete only |
Shift+Escape |
Deny |
Deny |
Denying and aborting use Shift+Escape (not Cmd+Escape, which is Claude Code's quick-launch shortcut).
Follow-up questions
Pick a suggested answer or type your own. The patch leaves these alone.
- Kilo Code auto-focuses the first option when the prompt appears, so keys act on the highlighted choice regardless of what is in the chat box.
- Arrow keys move between choices,
Enter selects, and Cmd/Ctrl+Enter send the choice.
Menus and dialogs
Model and mode pickers, confirmations, @-mentions. The patch leaves these alone, except that Escape in the @-mention menu now dismisses the query for good (see Keyboard patches).
- Kilo Code moves focus into them when they open and handles their keys: arrow keys or type-ahead to move,
Enter to choose, Escape to close pop-up menu without invoking the permission prompt abort.
Troubleshooting
- No effect: restart extensions (
Developer: Restart Extension Host) or reload the window after applying.
- Stopped working after a Kilo Code update: updates overwrite the patched files. KB Patch offers to re-apply on the next launch or restart, and you can run it yourself with
Cmd+Shift+P → Kilo Code KB Patch: Apply Patches.
- "Could not find a kilocode.kilo-code-* install": Kilo Code is not installed in this editor (the message lists every folder searched).
Install Kilo Code first, then re-run Apply Patches.