-
Notifications
You must be signed in to change notification settings - Fork 331
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
trash-restore mapping #579
Comments
@ranebrown Are you using |
I'm using bash 5.1.4 and I do have |
@ranebrown Are you on Mac? If so, #480 might be related. |
This works fine for me, requires fzf. #!/usr/bin/env sh
# (Better) interactive restore for trash-cli.
file="$(trash-list | grep "$(pwd)" | fzf | awk '{$1=$2=""; print substr($0,3)}')"
[ -z "$file" ] && exit 1
# THE KEY PART; yes, i know how ugly it looks
yes 0 | trash-restore "$file"
demo02.18.Sunday.14.Feb.2021.mp4 |
I am on a Mac. I tried a mapping to that script and it does successfully restore a file but it hangs before displaying the fzf window until I press a key. |
Hanging seems related to
|
This works so well that I very amazed. |
There has been multiple changes related to this. Feel free to reopen if the issue persists in r23. |
Here is a version based on #579 (comment) that supports selecting multiple files to restore: # lfrc
cmd fzf-restore ${{
ids="$(echo -ne '\n' | \
trash-restore | \
awk '$1 ~ /^[0-9]+/ {print $0}' | \
fzf --multi | \
awk '{print $1}' | \
sed -z 's/\n/,/g;s/,$/\n/')"
echo $ids | trash-restore
clear
}}
map U fzf-restore |
I'm trying to use trash-cli for delete operations using the below mappings. The delete works but restore seems to be broken for some reason. It will show the prompt to select a file to restore but then hangs after entering a number. Any ideas what is causing this?
The text was updated successfully, but these errors were encountered: