/ read -n1
https://unix.stackexchange.com/questions/617576/read-from-terminal-without-waiting-for-enter
This commit is contained in:
@@ -114,16 +114,15 @@ cmd recol %{{
|
||||
#cmd trash %set -f; mv $fx ~/.trash
|
||||
# $f: single file, $fx: multiple files
|
||||
|
||||
# https://github.com/gokcehan/lf/issues/45#issuecomment-260347057
|
||||
cmd trash %tp.sh "$fx"
|
||||
|
||||
# IFS=':'; echo $fs | tr " " "\n"
|
||||
|
||||
# https://github.com/gokcehan/lf/issues/45#issuecomment-260347057
|
||||
# https://unix.stackexchange.com/questions/617576/read-from-terminal-without-waiting-for-enter
|
||||
cmd trash-confirm ${{
|
||||
echo 'file(s) selected:'
|
||||
echo $fx
|
||||
echo 'delete? [y/n]'
|
||||
read ans
|
||||
read -n1 ans
|
||||
[ $ans = 'y' ] && (echo 'deleting files…' && trash %tp.sh "$fx") || echo 'cancelled…'
|
||||
}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user