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

Crash when setting max_console_history_size to none in rc.conf #1895

Open
zaeph opened this issue Apr 2, 2020 · 0 comments
Open

Crash when setting max_console_history_size to none in rc.conf #1895

zaeph opened this issue Apr 2, 2020 · 0 comments
Labels
Milestone

Comments

@zaeph
Copy link
Contributor

zaeph commented Apr 2, 2020

Hello there,

max_console_history_size is listed in the manual as accepting a none value to not cap the number of items remembered:

max_console_history_size [integer, none]
    How many console commands should be kept in history? "none" will disable the limit.

However, adding set max_console_history_size none to rc.conf crashes with the following trace-back:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/ranger/core/main.py", line 171, in main
    fm.initialize()
  File "/usr/lib/python3.8/site-packages/ranger/core/fm.py", line 132, in initialize
    self.ui.initialize()
  File "/usr/lib/python3.8/site-packages/ranger/gui/ui.py", line 119, in initialize
    self.setup()
  File "/usr/lib/python3.8/site-packages/ranger/gui/ui.py", line 300, in setup
    self.console = Console(self.win)
  File "/usr/lib/python3.8/site-packages/ranger/gui/widgets/console.py", line 40, in __init__
    self.history = History(self.settings.max_console_history_size)
  File "/usr/lib/python3.8/site-packages/ranger/container/history.py", line 16, in __init__
    assert maxlen is not None, "maxlen cannot be None"
AssertionError: maxlen cannot be None

I've tried to set the variable to none from inside ranger with :set max_console_history_size none, and whilst it didn't lead to a crash, it didn't do anything. So, unless the variable is only read on init, I don't think that max_console_history_size can accept none as its value.

I haven't had the chance to look into the code to see what might be causing it. A temporary measure could be to remove the line from the manual, but I still think this a desirable feature.

HTH.

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

No branches or pull requests

2 participants