feat(tui): add ctrl+r history search
Summary
Implements Ctrl+R history search functionality for the TUI prompt, allowing users to fuzzy search through their prompt history.
Changes
- Added
DialogHistorySearchcomponent with fuzzy filtering and deduplication - Increased max history entries from 50 to 100
- Added
itemsgetter andreset()method toPromptHistorycontext - Added
history_searchkeybind (default:ctrl+r) to config - Integrated history search into prompt component
Closes https://github.com/sst/opencode/issues/5062 Related #6276
Hey @jiahaoxiang2000! I implemented an alternative approach in #6276 that uses inline reverse-i-search (bash-style) instead of a modal dialog.
Key differences:
- Matches display directly in the prompt textarea rather than a separate dialog
- Follows the exact bash/zsh/fish convention:
(reverse-i-search)'query': N/M - Reuses existing prompt rendering for parts/extmarks instead of creating a separate list view
This was inspired by @ShpetimA's suggestion in #5062:
Maybe just simple search style like bash where you search and it shows on the input instantly instead of opening history modal.
Both approaches have merit - the modal provides a visual list which some users might prefer, while inline keeps the shell-like feel. Curious what the maintainers think about which direction fits better for opencode's TUI!