/ trash-confirm

possible done
This commit is contained in:
committer@tuxwarrior
2025-05-13 13:43:08 -05:00
parent d1e600ba80
commit 888a8d66b0

View File

@@ -36,8 +36,8 @@ set cleaner ctpvclear
# -------------------- # --------------------
# map # map
# -------------------- # --------------------
map <delete> :push trash-confirm # use '<delete>' key for 'trash' map <delete> trash-confirm # use '<delete>' key for 'trash'
#map <delete> trash # use '<delete>' key for 'trash' map <c-delete> trash
map <enter> shell # use enter for shell commands map <enter> shell # use enter for shell commands
map <esc> :unselect; clear # clear all selected map <esc> :unselect; clear # clear all selected
map ` !true # show the result of execution of previous commands map ` !true # show the result of execution of previous commands
@@ -114,11 +114,12 @@ cmd recol %{{
# (also see 'man mv' for backup/overwrite options) # (also see 'man mv' for backup/overwrite options)
#cmd trash %set -f; mv $fx ~/.trash #cmd trash %set -f; mv $fx ~/.trash
# $f: single file, $fx: multiple files # $f: single file, $fx: multiple files
# https://github.com/gokcehan/lf/issues/45#issuecomment-260347057 # https://github.com/gokcehan/lf/issues/45#issuecomment-260347057
#cmd trash %tp.sh "$fx" cmd trash %tp.sh "$fx"
cmd trash-confirm ${{ cmd trash-confirm ${{
echo 'delete?[y/n]' echo 'delete? [y/n]'
read ans read ans
[ $ans = 'y' ] && trash %tp.sh "$fx" || echo 'cancelled' [ $ans = 'y' ] && trash %tp.sh "$fx" || echo 'cancelled'
}} }}