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

New libcurses behavior breaks bulkrename #2934

Open
xe2io opened this issue Jan 11, 2024 · 2 comments
Open

New libcurses behavior breaks bulkrename #2934

xe2io opened this issue Jan 11, 2024 · 2 comments

Comments

@xe2io
Copy link

xe2io commented Jan 11, 2024

Runtime Environment

  • Operating system and version: Alpine Linux 3.19
  • Terminal emulator and version: foot, 1.16.2
  • Python version: 3.11.6
  • Ranger version/commit: 1.9.3, also tested on master [136416c]
  • Locale: en_US.UTF-8

Current Behavior

:bulkrename fails with endwin() returned ERR after first editor (default, vi) session is exited.

Message log:

21:51:15 INFO ranger version: ranger-master 
21:51:15 INFO Python version: 3.11.6 (main, Oct 13 2023, 15:52:55) [GCC 13.1.1 20230722]
21:51:15 INFO Locale: en_US.UTF-8
21:51:15 INFO Process ID: 28100
21:51:32 ERRO Notification: endwin() returned ERR
21:51:32 ERRO endwin() returned ERR
Traceback (most recent call last):
  File "/tmp/ranger/ranger-master/ranger/core/actions.py", line 272, in execute_console
    cmd.execute()
  File "/tmp/ranger/ranger-master/ranger/config/commands.py", line 1295, in execute
    self.fm.execute_file([File(cmdfile.name)], app='editor')
  File "/tmp/ranger/ranger-master/ranger/core/actions.py", line 446, in execute_file
    return execute()
           ^^^^^^^^^
  File "/tmp/ranger/ranger-master/ranger/core/actions.py", line 444, in execute
    return self.rifle.execute(filenames, mode, label, flags, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/ranger/ranger-master/ranger/ext/rifle.py", line 440, in execute
    self.hook_before_executing(command, self._mimetype, self._app_flags)
  File "/tmp/ranger/ranger-master/ranger/core/fm.py", line 136, in <lambda>
    self.ui.suspend() if 'f' not in flags else None
    ^^^^^^^^^^^^^^^^^
  File "/tmp/ranger/ranger-master/ranger/gui/ui.py", line 160, in suspend
    curses.endwin()
_curses.error: endwin() returned ERR

Expected Behavior

Following first editor window closing, new editor instance with the changes is displayed prompting user for confirmation.

Context

Bulk rename files :)

This behavior appears to be caused by the change described in this thread

Possible Solutions

Catch the new Exception to allow the bulkrename operation to continue.

Steps to reproduce

  1. Create test directory with files and launch ranger
d=$(mktemp -d) && touch $d/{1..3} && ranger $d
  1. Mark multiple files
  2. Use the :bulkrename command
  3. make some changes in the editor and save and quit
%s/$/-d/g
@bleuse
Copy link

bleuse commented Jan 11, 2024

I'm also impacted by this bug.
Running debian testing with ranger 1.9.3-5 and libncurses6 6.4+20231209-1.

The proposed solution seems to work.

mojyack added a commit to mojyack/etc-portage that referenced this issue May 13, 2024
@randomcodepanda
Copy link

randomcodepanda commented May 24, 2024

Ncurses got updated in Arch and i couldn't bulkrename anymore with the same ENDWIN error, i tried that fix and it seems to work now.

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

No branches or pull requests

3 participants