From 1429d9bdf446c2d6272925a4dc029215a24ea81b Mon Sep 17 00:00:00 2001 From: xyz Date: Sat, 6 Nov 2021 00:42:04 -0700 Subject: use printf %q --- home/xyz/.bashrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'home/xyz/.bashrc') diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index 1812f25..070f969 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -79,7 +79,8 @@ alias zqi='zoxide query -i' # all green color, no auto turn off color when pipe to nvim #alias pactree='pactree -c' -eval "$(zoxide init posix --hook prompt --no-aliases)" +#eval "$(zoxide init posix --hook prompt --no-aliases)" +eval "$(zoxide init bash)" z () { __zoxide_z "$@" && l @@ -93,9 +94,8 @@ zi () { # READLINE_LINE and READLINE_POINT see `man bash` zqi_key () { # fzf uses printf '%q' to escape output, but attention %q is not POSIX - # well we use bashism here so whatever, but use single quotes here also seems work fine so whatever - # maybe consider deal with FZF_DEFAULT_COMMAND not escape path at .profile instead - selected="'$(zoxide query -i)'" + # well we use bash here so whatever + selected=$(printf '%q ' "$(zoxide query -i)") READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$selected${READLINE_LINE:$READLINE_POINT}" READLINE_POINT=$((READLINE_POINT+${#selected})) } -- cgit v1.2.3-70-g09d2