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

ranger crashes when switching to a tab whose directory doesn’t exist anymore if update_title is set to true #2873

Open
vejkse opened this issue Jul 12, 2023 · 0 comments · May be fixed by #2896
Labels
Milestone

Comments

@vejkse
Copy link

vejkse commented Jul 12, 2023

Runtime Environment

  • Python version: 3.11.3 (main, Jun 5 2023, 09:32:32) [GCC 13.1.1 20230429]
  • Ranger version/commit: 1a00715
  • Locale: en_US.UTF-8

These crashes started occurring with commit fe7c3b2. With commit 478d5b6, when switching to the tab whose directory doesn’t exist any more, we just end up in its parent directory.

Current Behavior

When going back to a tab whose directory doesn’t exist any more, ranger crashes.

Expected Behavior

For ranger not to crash, to avoid losing the current working context.

Possible Solutions

Downgrade ranger or set update_title to false.

Steps to reproduce

  1. Run ranger --clean in a terminal.
  2. :set update_title true
  3. Create a new directory called z.
  4. Open a second tab.
  5. In the second tab, browse into z.
  6. Go back to the first tab.
  7. Delete or trash z.
  8. Go back to the second tab.

At that moment, ranger crashes.

Traceback

Python version: 3.11.3 (main, Jun  5 2023, 09:32:32) [GCC 13.1.1 20230429]
Locale: en_US.UTF-8

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/ranger/core/main.py", line 214, in main
    fm.loop()
  File "/usr/lib/python3.11/site-packages/ranger/core/fm.py", line 417, in loop
    ui.redraw()
  File "/usr/lib/python3.11/site-packages/ranger/gui/ui.py", line 343, in redraw
    self.draw()
  File "/usr/lib/python3.11/site-packages/ranger/gui/ui.py", line 372, in draw
    cwd = self.fm.thisdir.path
          ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'path'
@toonn toonn added the bug label Aug 17, 2023
@toonn toonn added this to the v1.9.4 milestone Aug 17, 2023
80KiloMett pushed a commit to 80KiloMett/ranger that referenced this issue Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants