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

.cling_history shouldn't grow infinitely #477

Open
Axel-Naumann opened this issue Nov 14, 2022 · 8 comments
Open

.cling_history shouldn't grow infinitely #477

Axel-Naumann opened this issue Nov 14, 2022 · 8 comments

Comments

@Axel-Naumann
Copy link
Member

Explain what you would like to see improved

.cling_history currently grows without limits, we have some that are 144M.

Optional: share how it could be improved

We probably want both:

  1. drop the oldest entries, such that it remains < 1M or so.
  2. prevent the cling test suite from adding to the history - that's useless.
@dimitry-ishenko
Copy link

dimitry-ishenko commented May 10, 2023

Maybe follow what bash does with .bash_history? There are two env vars -- HISTSIZE and HISTFILESIZE -- which control how many commands are stored in the file and max file size.

By default HISTSIZE is 500 and HISTFILESIZE is 0.

cling can have two variables -- CLING_HISTSIZE and CLING_HISTFILESIZE -- that are initialized to the same values (500 and 0) by default and allow overriding them.

@dimitry-ishenko
Copy link

As regards to the 2nd point, I remember seeing some commits in @vgvassilev's repo that allowed one to specify custom history file. So, the test suite shoud set it to some file using eg mktemp and not pollute the default one.

@dimitry-ishenko
Copy link

It looks like point 2 has already been implemented in 90a7639. Just need to get the test suite to specify a temp history file.

@dimitry-ishenko
Copy link

dimitry-ishenko commented May 10, 2023

And it seem CLING_HISTSIZE has also been implemented in 392d536. It just needs to default to a sane value.

@dimitry-ishenko
Copy link

@Axel-Naumann are you still interested in this issue? If so, let me know and I can take a stab at it. Otherwise, I'd hate to do something that will then rot in a neglected PR forevermore.

@Axel-Naumann
Copy link
Member Author

I'm totally interested - I just have very little time slices for this. I'd be amazing if you proposed something! Setting a default, non-infinity value as the upper limit seems the way to go?

@richen666
Copy link

@Axel-Naumann @dimitry-ishenko
Is there any progress in this issue? If not, I want to try it.

@dimitry-ishenko
Copy link

@richen666 sorry, no progress from me, I've been busy with other things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants