From 1baa204f5073fd75fc8c49dfebbb3dcb03d751a3 Mon Sep 17 00:00:00 2001 From: "committer@tuxwarrior" Date: Tue, 13 May 2025 17:12:28 -0500 Subject: [PATCH] / read -n1 https://unix.stackexchange.com/questions/617576/read-from-terminal-without-waiting-for-enter --- dots/lf/lfrc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dots/lf/lfrc b/dots/lf/lfrc index d67038a..03d6e2e 100644 --- a/dots/lf/lfrc +++ b/dots/lf/lfrc @@ -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…' }}