Skip to content

load history file on startup for libedit#119

Open
dallinjdahl wants to merge 1 commit intorakitzis:masterfrom
dallinjdahl:master
Open

load history file on startup for libedit#119
dallinjdahl wants to merge 1 commit intorakitzis:masterfrom
dallinjdahl:master

Conversation

@dallinjdahl
Copy link

plain text history file is ideal, but libedit deserializes history from it's own format. This loads the history file line by line.

@oliwer
Copy link
Contributor

oliwer commented Feb 2, 2026

Thanks for this! Just one question: why do you fseek just after the fopen? Is it possible for the file handler to not be at the start?

@dallinjdahl
Copy link
Author

I don't want to read the entire history file, especially given that the default limit for history entries is 20. Given the possibility of extremely long history files (useful for analytics on usage patterns and so on), we just read in the last 5k, which should stay performant.

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

Successfully merging this pull request may close these issues.

2 participants