claude-code - 💡(How to fix) Fix [FEATURE] Generic bindable action to send literal text / run a command from a keypress

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Because the action set is closed, every new capability has to be shipped as its own named action, which has produced a stream of narrow one-off requests (#57600 bindable /clear, #60865 word-delete actions, #64855 bash-mode submit variants, #62621 transcript prompt-jump). A single generic "send text" action would subsume this entire class.

Code Example

{
  "context": "Chat",
  "bindings": {
    "ctrl+g": { "type": "sendText", "text": "Continue", "submit": true },
    "ctrl+shift+k": { "type": "sendText", "text": "/clear", "submit": true }
  }
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

keybindings.json can only map a key to a fixed enum of built-in actions. There is no way to bind a key to arbitrary text, or to a slash command. As a result, text I type constantly — "Continue", "yes", /clear — can't be put on a single key.

Because the action set is closed, every new capability has to be shipped as its own named action, which has produced a stream of narrow one-off requests (#57600 bindable /clear, #60865 word-delete actions, #64855 bash-mode submit variants, #62621 transcript prompt-jump). A single generic "send text" action would subsume this entire class.

Proposed Solution

Allow a binding's action value to be an object, not just a string:

{
  "context": "Chat",
  "bindings": {
    "ctrl+g": { "type": "sendText", "text": "Continue", "submit": true },
    "ctrl+shift+k": { "type": "sendText", "text": "/clear", "submit": true }
  }
}
  • text — literal string inserted at the cursor.
  • submit (default false) — if true, submit immediately; if false, insert so the user can edit first.

Backward-compatible: existing string / null action values are unchanged.

Alternative Solutions

Terminal-emulator key macros (iTerm2 "Send Text", Kitty send_text, Ghostty text:) can send a string on a keypress, but they fire in every program in that terminal — the terminal can't tell which TUI is focused, so there's no way to scope the macro to Claude Code. An in-app binding is the only way to get a Claude-Code-only shortcut.

Priority

Low - Nice to have

Feature Category

Interactive mode (TUI)

Use Case Example

  1. I frequently nudge an agent forward by typing "Continue" and Enter.
  2. I add "f5": { "type": "sendText", "text": "Continue", "submit": true } to keybindings.json.
  3. Pressing F5 now submits "Continue" without typing — only inside Claude Code.

Additional Context

Related: #62623 (slash commands don't submit under remapped submit keys) would exercise the same path as sendText with submit: true on a /command.

Environment: Claude Code 2.1.165, macOS (Darwin 25.5.0).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING