[BUG] Ctrl+G during Ctrl+R prompt search doesn't select prompt, edits lost
Resolved 💬 3 comments Opened Jan 6, 2026 by hjtenklooster Closed Feb 21, 2026
Bug Description
When using Ctrl+R to search prompt history and pressing Ctrl+G to edit the highlighted prompt in an external editor, edits made in the editor are lost upon return.
Steps to Reproduce
- Have at least one previous prompt in history
- Press
Ctrl+Rto enter prompt search mode - Type a search term that matches a previous prompt (e.g., "te")
- A matching prompt is highlighted
- Press
Ctrl+Gdirectly (without pressingTabto select first) - External editor (neovim) opens with the full matched prompt content
- Edit the prompt in the editor
- Save and exit (
:wq) - Return to Claude Code
Expected Behavior
The edited prompt should appear in the input field.
Actual Behavior
Claude Code is still in search mode (search prompts: te visible). Edits are lost.
Workaround
Press Tab to select the prompt before pressing Ctrl+G.
Suggested Fix
When Ctrl+G is pressed during search mode with a highlighted prompt, auto-select that prompt first (equivalent to pressing Tab), then open the external editor.
Environment
- Platform: macOS (darwin)
- Terminal: Ghostty
- Version: 2.0.76
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗