euporie.core.history

Define input history loaders.

Classes

History()

Base History class.

KernelHistory(kernel[, n])

Load the kernel's command history.

class euporie.core.history.KernelHistory(kernel: Kernel, n: int = 1000)

Bases: prompt_toolkit.history.History

Load the kernel’s command history.

append_string(string: str) None

Add string to the history.

get_strings() list[str]

Get the strings from the history that are loaded so far. (In order. Oldest item first.)

async load() AsyncGenerator[str, None]

Load the history and yield all entries, most recent history first.

This method can be called multiple times from the Buffer to repopulate the history when prompting for a new input. So we are responsible here for both caching, and making sure that strings that were were appended to the history will be incorporated next time this method is called.

Yields

Each history string

load_history_strings() Iterable[str]

Not used to load history, as we load it asynchronously.

property recent: list[str]

Return new items added since history was initially loaded.

store_string(string: str) None

Don’t store strings in persistent storage: they are stored by the kernel.