gitlab icon indicating copy to clipboard operation
gitlab copied to clipboard

Need to implement size limit for shell mode history file.

Open asedge opened this issue 11 years ago • 3 comments

Should probably top out at around 1k entries.

Limit could be hard coded and then overridden via ENV variable, e.g. GITLAB_HISTFILESIZE or something similar, in case some users want a larger/smaller histfile.

asedge avatar Dec 09 '14 00:12 asedge

How about about limiting the size to GITLAB_HISTFILESIZE when exiting the shell?

Since we're currently appending to the file after each command, I'm not sure about trying to rewrite a potentially large file each time.

chrisdambrosio avatar Dec 09 '14 23:12 chrisdambrosio

It looks like I have something that works. I decided to set the default number of entries to save to 200. It required a small refactor. See the referenced commit if interested in providing feedback.

asedge avatar Dec 11 '14 02:12 asedge

@asedge I added my take on this as #95.

I think that the History class should be responsible for adding entries to Readline::HISTORY.

chrisdambrosio avatar Dec 12 '14 00:12 chrisdambrosio