[GH-ISSUE #727] [Feature Request] Search history and reverse search #291

Open
opened 2026-02-28 14:48:17 +03:00 by kerem · 2 comments
Owner

Originally created by @jayache80 on GitHub (Jan 27, 2021).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/727

I find myself listening to things over and over and over, and don't like to type the full artist/album/song/whatever each time.

It would be great if all the Search Input entries that are made were stored in a history file, perhaps:

~/.config/spotify-tui/.search_history

similar to how bash will store previous command line entries in the $HISTFILE file.

Then, listen for Ctrl+R in the Search Input box and reverse search your previous Search Input entries. This way you could type a few characters and quickly repeat a previous search. Similarly Ctrl+P (or ) and Ctrl+N (or ) would traverse up and down the history as you'd expect.

Originally created by @jayache80 on GitHub (Jan 27, 2021). Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/727 I find myself listening to things over and over and over, and don't like to type the full artist/album/song/whatever each time. It would be great if all the Search Input entries that are made were stored in a history file, perhaps: ``` ~/.config/spotify-tui/.search_history ``` similar to how `bash` will store previous command line entries in the `$HISTFILE` file. Then, listen for <kbd>Ctrl</kbd>+<kbd>R</kbd> in the Search Input box and reverse search your previous Search Input entries. This way you could type a few characters and quickly repeat a previous search. Similarly <kbd>Ctrl</kbd>+<kbd>P</kbd> (or <kbd>&#8593;</kbd>) and <kbd>Ctrl</kbd>+<kbd>N</kbd> (or <kbd>&#8595;</kbd>) would traverse up and down the history as you'd expect.
Author
Owner

@jayache80 commented on GitHub (Feb 19, 2021):

I started working on this but it was getting more and more hacky. What are the thoughts on bringing in a bona fide readline library, like rustyline?

<!-- gh-comment-id:782326834 --> @jayache80 commented on GitHub (Feb 19, 2021): I started working on this but it was getting more and more hacky. What are the thoughts on bringing in a bona fide readline library, like [rustyline](https://github.com/kkawakam/rustyline)?
Author
Owner

@jayache80 commented on GitHub (Feb 20, 2021):

On second thought, after trying a few examples, I see the difficulties in combining tui-rs and rustyline. Until some sort of readline paradigm is established upstream in the tui-rs user input widget, it seems the best way is to implement more "pseudo-readline" features in handlers/input.rs as the codebase is already doing.

I have something working and I'll submit a pull-request soon.

<!-- gh-comment-id:782749909 --> @jayache80 commented on GitHub (Feb 20, 2021): On second thought, after trying a few examples, I see the difficulties in combining tui-rs and rustyline. Until some sort of readline paradigm is established upstream in the tui-rs user input widget, it seems the best way is to implement more "pseudo-readline" features in handlers/input.rs as the codebase is already doing. I have something working and I'll submit a pull-request soon.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-tui#291
No description provided.