Skip to content

Way to Iterate Through History #213

@ClaytonNorthey92

Description

@ClaytonNorthey92

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) {
  ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions