Skip to content
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

Way to Iterate Through History #213

Open
ClaytonNorthey92 opened this issue Jul 22, 2023 · 0 comments
Open

Way to Iterate Through History #213

ClaytonNorthey92 opened this issue Jul 22, 2023 · 0 comments

Comments

@ClaytonNorthey92
Copy link

As far as I can tell, linenoise does not provide a way to read lines in history via its API. I think this would be useful. I think a way to implement this could be to allow history to be iterated on.

perhaps something like...

struct HistoryIter {
  char ** history; // a pointer to the history, same type as history itself (perhaps the same reference or a copy)
  int count; // the number of lines in history
}

struct HistoryIter linenoiseGetHistory();

or maybe a macro...

char * line;
LINENOISE_HISTORY_FOREACH_LINE(line) {
  ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant