Escape should exit search mode (Vim-like behavior) #4
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-verification
question
queue
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/fzt-terminal#4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently Escape in search mode with a non-empty query clears the query but keeps us in search mode (step 2 of the unwind cascade in CLAUDE.md's "Back-out / unwind cascade" section).
Vim's Escape exits insert mode — the free-typing mode. fzt's search mode is the analogous free-typing mode. Escape should exit it into normal mode, so the muscle memory carries over.
Proposed change
In search mode, Escape should transition to normal mode (cursor on tree). The query could be preserved — Vim's Escape doesn't wipe the line you just typed.
This would reorder the unwind cascade so the mode transition happens before query clearing. Subsequent Escape presses in normal mode would still unwind query → scope → context → cancel.
Questions to resolve
Related: the existing backtick (`) binding already does "enter normal mode" from search, so this is adding an alternative entry point that matches the Vim convention.
Wrong repo — the search-mode Escape behavior is implemented in the engine at core/input.go::HandleSearchKey. Refiling on nelsong6/fzt.