From d9ae5a9f15964d68ab192f99bd8c6996aa76f483 Mon Sep 17 00:00:00 2001 From: "committer@tuxwarrior" Date: Tue, 13 May 2025 13:29:33 -0500 Subject: [PATCH] /+ trash confirm wip --- dots/lf/lfrc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dots/lf/lfrc b/dots/lf/lfrc index f8d376b..5255a41 100644 --- a/dots/lf/lfrc +++ b/dots/lf/lfrc @@ -36,7 +36,8 @@ set cleaner ctpvclear # -------------------- # map # -------------------- -map trash # use '' key for 'trash' +map :push trash-confirm # use '' key for 'trash' +#map trash # use '' key for 'trash' map shell # use enter for shell commands map :unselect; clear # clear all selected map ` !true # show the result of execution of previous commands @@ -113,7 +114,14 @@ cmd recol %{{ # (also see 'man mv' for backup/overwrite options) #cmd trash %set -f; mv $fx ~/.trash # $f: single file, $fx: multiple files -cmd trash %tp.sh "$fx" +# https://github.com/gokcehan/lf/issues/45#issuecomment-260347057 +#cmd trash %tp.sh "$fx" + +map trash-confirm ${{ + echo 'delete?[y/n]' + read ans + [ $ans = 'y' ] && trash %tp.sh "$fx" || echo 'cancelled' +}} # extract the current file with the right command (https://xkcd.com/1168/) cmd extract %extract.sh "$f"