jarun/nnn

Clear selection (mm) does not delete .selection file causing copy/move to error

teeratpitakrat opened this issue · 2 comments

Environment details

[x] Operating System: Arch Linux
[ ] Desktop Environment: None (i3wm)
[x] Terminal Emulator: alacritty
[x] Shell: zsh
[ ] Custom desktop opener (if applicable):
[ ] Program options used:
[ ] Configuration options set:
[x] Issue exists on nnn master

Exact steps to reproduce the issue

  1. Select one or more files with space or m
  2. Clear selection with mm
  3. Try to copy (p) or move (v) with empty buffer
Expected result

The ~/.config/nnn/.selection file is deleted and the copy/paste operation returns 0 selected at the bottom of the window. No file is copied/moved.

Actual result

An error message is shown:

cp: cannot stat 'sh': No such file or directory
'Enter' to continue

The content of .selection file is deleted but the empty file is still in ~/.config/nnn/.

This does not happen when clearing selection with space. The problem is that if the window is redrawn (after switching the context), the + symbol disappears and the file cannot be deselected with space.

KlzXS commented

The selection file is behaving as is intended. There was a check for empty selection missing.

Thank you!

Thanks! Resolved in master.