From 1bf49c80e734d7fdefda0686d81f95a1ce619b10 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Tue, 26 Nov 2019 04:36:31 -0800 Subject: Some of the shell script fixes as per discussion (#389) * Improved completion support for files with spaces Filenames with spaces, both generally and for session names, will now complete as expected. * Misc shell script improvements See discussion on: https://github.com/jarun/nnn/commit/1cca9e4b72b106374f203890b266f18609deefe3 --- plugins/dragdrop | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugins/dragdrop') diff --git a/plugins/dragdrop b/plugins/dragdrop index ee4fc20..bbbd19e 100755 --- a/plugins/dragdrop +++ b/plugins/dragdrop @@ -24,8 +24,7 @@ fi add_file () { - printf "%s" "$@" >> "$selection" - printf "\0" >> "$selection" + printf '%s\0' "$@" >> "$selection" } use_all () @@ -57,7 +56,7 @@ elif [ "$resp" = "d" ]; then use_all "$dnd" "$all" "$PWD/"* & elif [ "$resp" = "r" ]; then - printf > "$selection" + true > "$selection" "$dnd" --print-path --target | while read -r f do if printf "%s" "$f" | grep '^\(https\?\|ftps\?\|s\?ftp\):\/\/' ; then -- cgit v1.2.3-70-g09d2