-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More flexible history save/load #127
Comments
Hi,
Does any alternative (liner, linefeed, linenoise, linenoise-ng, haskeline,
jline3, ...) have such feature ?
Just to figure out if a smart API already exists (even if not compatible
with Rust).
Thanks.
PS: I do not feel able to merge PR. I do not master Rust. Sorry.
…On Thu, Mar 1, 2018 at 2:51 PM, d-dorazio ***@***.***> wrote:
@gwenn <https://github.com/gwenn> would you be open to accept a PR to
solve this issue? I can work on this if @netvl <https://github.com/netvl>
hasn't already implemented it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#127 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACx8q2qH9Gjc71YSaKklqbpTSQEs_Wmks5tZ_zFgaJpZM4RLYvE>
.
|
@gwenn I have taken a look at the libraries you listed and found the following:
This is kinda surprising for me; making history management modular is such an obvious thing to me, I don't understand why it is not supported by almost all readline-like libraries out there. |
Ok, Or an |
I've long wanted a more flexible history solution for my shell. I currently use a bunch of hacks to share history between different open bash shells, forcing them to save and load history between each command. This mostly works, but the biggest downside is that the ordering of commands in each shell is not preserved, so up arrow sometimes produces counter-intuitive results because it will return the last command executed in any shell. It would be nice to have something that could make this work nicely--a history that's shared among multiple running programs, but where each program has its own linear set of history entries. |
Fix kkawakam#127 Fix kkawakam#442 TODO - [ ] check if `History::add` and `History::add_owned` can be fused - [ ] put old / default `FileHistory` behind a feature - [ ] SQLite based implementation behind a feature - [ ] timestamped history ? Implementation detail ? - [ ] editable entry ? later ? Breaking changes: * `Editor` impacted (new generic type parameter `I`) * `History` renamed to `FileHistory` * History API impacted (to make trait object safe)
4 years later => #604 |
5 years later => version 11.0.0 released. |
I would like to be able to save user input history to and load it from a database. However, the current load/save API requires using a file. It is kind of possible to load/save history in line-by-line fashion, but this is suboptimal - there is no method on
History
to access the underlyingVecDeque
, and there is also no way to fill it with lines without usingadd()
which performs the history addition logic.One possible solution I see would be to implement the following pair of methods:
I can do this, but will the PR be merged? I see that the repo is not very active.
The text was updated successfully, but these errors were encountered: