Removed spin because the "eval" part of it was broken and it adds

unnecessary complexity.
This commit is contained in:
Bruce Hill 2019-11-04 15:28:00 +01:00
parent 1f4122d8d5
commit 4343251629
2 changed files with 4 additions and 20 deletions

18
bb.h
View File

@ -25,7 +25,7 @@
#include "bterm.h"
// Macros:
#define BB_VERSION "0.18.0"
#define BB_VERSION "0.19.0"
#ifndef PATH_MAX
#define PATH_MAX 4096
@ -308,22 +308,6 @@ PICK ";\n"
" grep -i -m1 \"$(echo \"$query\" | sed 's;.;[^/&]*[&];g')\";\n"
#endif
"}\n"
"spin() {\n"
#ifdef SPIN
SPIN ";\n"
#else
" eval \"$@\" &\n"
" pid=$!;\n"
" spinner='-\\|/';\n"
" sleep 0.01;\n"
" while kill -0 $pid 2>/dev/null; do\n"
" printf '%c\\033[D' \"$spinner\" >/dev/tty;\n"
" spinner=\"$(echo $spinner | sed 's/\\(.\\)\\(.*\\)/\\2\\1/')\";\n"
" sleep 0.1;\n"
" done;\n"
" wait $pid;\n"
#endif
"}\n"
#ifdef SH
"alias sh=" SH";\n"
#else

View File

@ -115,7 +115,7 @@ D: # Delete all selected files
confirm && rm -rf "$@" && bb +deselect +refresh
Ctrl-v: # Move files here
printf "\033[1mMoving the following to here:\n \033[33m$(printf ' %s\n' "$@")\033[0m" | more &&
confirm && spin mv -i "$@" . && bb +deselect +refresh &&
confirm && mv -i "$@" . && bb +deselect +refresh &&
for f; do bb +sel:"$(basename "$f")"; done ||
pause
c: # Copy a file
@ -124,8 +124,8 @@ C: # Copy all selected files here
[ $# -gt 0 ] && printf "\033[1mCopying the following to here:\n \033[33m$(printf ' %s\n' "$@")\033[0m" | more &&
confirm &&
for f; do if [ "./$(basename "$f")" -ef "$f" ]; then
spin cp -ri "$f" "$f.copy";
else spin cp -ri "$f" .; fi; done; bb +refresh
cp -ri "$f" "$f.copy" || break;
else cp -ri "$f" . || break; fi; done; bb +refresh
Ctrl-n: # New file/directory
case "$(printf '%s\0' File Directory | pick "Create new: ")" in
File)