diff --git a/bin/launcher.sh b/bin/launcher.sh index 21ca1cd..64c1efd 100755 --- a/bin/launcher.sh +++ b/bin/launcher.sh @@ -12,7 +12,9 @@ FZF_OPTIONS="--layout=reverse --no-extended --print-query --no-sort" # Get shell command list # This may include the occasional non-executable file # command_list=$({ IFS=:; ls -H $PATH; } | grep -v '/.*' | sort -u) -command_list=$(find $(echo $PATH | tr ':' ' ') -type f -executable -printf "\n%f") +command_list=$(\ + find $(echo $PATH | tr ':' ' ') -type f -executable -printf "\n%f" | \ + sort -u) # read existing command history if [ -f "$HIST_FILE" ]; then command_history=$(cat "$HIST_FILE") @@ -31,7 +33,7 @@ if [ "$command_str" = "" ]; then fi # echo "Command: $command_str" -# using \E flag from perl regex +# using \E flag from https://github.com/junegunn/fzfperl regex test "${command_str#*\\E}" != "$command_str" && echo "command can't contain '\E'" test "${command_str#*\\E}" != "$command_str" && exit 1