Skip to content

feat(ui): rebind ctrl+c to clear input, ctrl+q to quit, ctrl+u to restore#3083

Open
CnsMaple wants to merge 2 commits into
charmbracelet:mainfrom
CnsMaple:feat/shortcut-keys
Open

feat(ui): rebind ctrl+c to clear input, ctrl+q to quit, ctrl+u to restore#3083
CnsMaple wants to merge 2 commits into
charmbracelet:mainfrom
CnsMaple:feat/shortcut-keys

Conversation

@CnsMaple

@CnsMaple CnsMaple commented Jun 5, 2026

Copy link
Copy Markdown

Summary

  • Reassign the global Quit binding from ctrl+c to ctrl+q
  • Add Editor.ClearInput (ctrl+c) to clear the textarea while the editor is focused; the cleared value is retained
  • Add Editor.RestoreInput (ctrl+u) to restore the most recently cleared value back into the editor
  • Update the quit dialog and commands panel shortcuts to reflect ctrl+q
  • Surface the new bindings in ShortHelp/FullHelp

Test plan

  • go build ./...
  • go test ./internal/ui/...
  • Manual: editor focused, type text, press ctrl+c — input clears
  • Manual: after clearing, press ctrl+u — input is restored
  • Manual: global ctrl+q opens the quit dialog; ctrl+y still toggles yolo; ctrl+z still suspends

💘 Generated with Crush

Assisted-by: Crush:MiniMax-M3

CnsMaple added 2 commits June 5, 2026 16:30
…+u restore

- Reassign Quit binding from ctrl+c to ctrl+q
- Add Editor.ClearInput (ctrl+c) to reset the textarea when focused
- Add Editor.RestoreInput (ctrl+u) to restore the most recently cleared value
- Update quit dialog and commands panel shortcuts to reflect ctrl+q
- Surface new bindings in ShortHelp/FullHelp

💘 Generated with Crush

Assisted-by: Crush:MiniMax-M3
Move the clear/restore input hints out of the always-visible bottom bar;
they remain in the expanded help shown via ctrl+g.

💘 Generated with Crush

Assisted-by: Crush:MiniMax-M3
@kke

kke commented Jun 8, 2026

Copy link
Copy Markdown

Codex and Claude both exit with ctrl-d (which is pretty usual for anything that has a prompt, such as shells, it's the EOF).

The annoying part there is that Claude requires two presses and codex just one, which causes me to often press it twice in codex, which ends up closing the underlying shell.

I'd prefer ctrl-d to "close prompt", which usually will mean end Crush?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants