1.0 KiB
1.0 KiB
Shell History Integration (integration/history.go)
The history module provides the Ctrl+R fuzzy search functionality by reading the user's persistent shell command history.
Features
- Zsh Extended Support: Specifically parses the
: <timestamp>;<command>format common in Zsh. - Lazy Loading: Doesn't read the disk until the user actually requests history. This keeps startup time instantaneous.
- Fuzzy Search: Integrated with the
fuzzysearch engine. - Deduplication: Automatically hides duplicate entries, showing only the most unique command variants.
Data Flow
- User presses
Ctrl+R. rootsetsmode = "history".SearchHistory("")is called.- If
cacheis empty:- Reads
~/.zsh_history. - Strips metadata using
;delimiter. - Populates a slice of commands.
- Reads
- Search matches are sorted by the
fuzzyengine. - Suggestions are returned to the
overlayfor rendering.
Configuration
It currently looks for .zsh_history in the user's home directory.