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

IRB.conf[:SAVE_HISTORY] setting is ignored resuling in cutting the irb history #138

Closed
dima4p opened this issue Mar 29, 2020 · 5 comments · Fixed by #147
Closed

IRB.conf[:SAVE_HISTORY] setting is ignored resuling in cutting the irb history #138

dima4p opened this issue Mar 29, 2020 · 5 comments · Fixed by #147

Comments

@dima4p
Copy link

dima4p commented Mar 29, 2020

Description

I have IRB.conf[:SAVE_HISTORY] = 100000 but after I close irb, the history file is cut to 500 lines.

Terminul Emulator

I use Konsole

Suggestions

There must be implemented a way Reline::Config access IRB.conf[:SAVE_HISTORY] and use it as value for @history_size.

At least there must be a way to configure @history_size.

@dima4p
Copy link
Author

dima4p commented Apr 25, 2020

At least there must be a way to configure @history_size.

Unlimited history size is much better. But it is not a best one. I suggested to use an environment variable. For example: IRB_HISTORY_SIZE.

@aycabta
Copy link
Member

aycabta commented May 2, 2020

I think IRB.conf[:SAVE_HISTORY] setting with number works correctly the latest version. Please run gem install irb reline.

@dima4p
Copy link
Author

dima4p commented May 2, 2020

I think IRB.conf[:SAVE_HISTORY] setting with number works correctly the latest version. Please run gem install irb reline.

At the moment in master I see the old code with value -1

@aycabta
Copy link
Member

aycabta commented May 3, 2020

  • The previous Reline's default history size on memory was 500, it means "drops history over 500"
  • Now, the default value of history-size in Reline on memory that is based on GNU Readline's specification is unlimited (-1)
  • The default value of IRB.conf[:SAVE_HISTORY] in IRB is 1000, it means "IRB saves the history of this number, from Reline's histories on memory to IRB's history file"

So, Reline keeps unlimited history by default, IRB saves 1000 history by default. And you can specify IRB's history size by IRB.conf[:SAVE_HISTORY] in ~/.irbrc.

@dima4p
Copy link
Author

dima4p commented May 3, 2020

* Now, the default value of `history-size` in Reline on memory that is based on GNU Readline's specification is unlimited (`-1`)

Yes, it is a good solution, sure. My point is to create an own environment variable that defines the limit and use -1 when it is not set. It is clear we can not use IRB.conf here.

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

Successfully merging a pull request may close this issue.

2 participants