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

Custom delete command needs two "y" keystrokes #554

Closed
rockyzhang24 opened this issue Jan 7, 2021 · 4 comments
Closed

Custom delete command needs two "y" keystrokes #554

rockyzhang24 opened this issue Jan 7, 2021 · 4 comments
Labels

Comments

@rockyzhang24
Copy link
Contributor

rockyzhang24 commented Jan 7, 2021

Hello,

First I put the info of my setup here:

  • macOS version: Big Sur 11.1
  • lf version: the lastest, built from the source.

I tested the custom delete command in the lfrc example. I need to press two y to delete a file. Is this expected?

The custom command and keybinding in the lfrc:

cmd delete ${{
  set -f
  printf "$fx\n"
  printf "delete?[y/N]"
  read ans
  [ $ans = "y" ] && rm -rf $fx
}}

map D delete

Then I create a new temp file by touch temp under my home folder for this testing. Next, I open lf and press D on this temp file. It goes back to the shell to ask me y or N, I press y followed by Enter. The cursor moves to the next line waiting for me to press another key. Next,

  • if at this time I press Enter, it goes back to lf but the deletion fails. I quit lf, and I can see an error showing --: line 6: [: =: unary operator expected. I attached a short video below as a demo.
Screen.Recording.2021-01-07.at.8.59.21.AM.mov
  • if at this time I press y again, it goes back to lf and the deletion successes. A short video attached below.
Screen.Recording.2021-01-07.at.9.02.45.AM.mov

is this behavior (two keystrokes needed) expected?
Thank you very much.

@rockyzhang24 rockyzhang24 changed the title Custom delete command needs two "y" keystroke Custom delete command needs two "y" keystrokes Jan 8, 2021
@gokcehan
Copy link
Owner

gokcehan commented Jan 8, 2021

@yanzhang0219 The issue is likely related to #480 which I can't do much at the moment.

@gokcehan gokcehan added the bug label Jan 8, 2021
@rockyzhang24
Copy link
Contributor Author

Okay I see. Thank you.
However, as a macOS user, this issue makes me discontinue using lf. I really love lf, and hope it could be solved soon.

@gokcehan
Copy link
Owner

gokcehan commented Jun 8, 2021

There has been multiple changes in regards to this and I'm not sure if we forgot to close this issue or the issue still persists. I'm closing this issue now. Feel free to reopen if the issue is reproducible with version r23.

@gokcehan gokcehan closed this as completed Jun 8, 2021
@rockyzhang24
Copy link
Contributor Author

Thank you. I just now tested it and I confirm this bug is fixed. 👍

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