diff options
| author | xyz <gky44px1999@gmail.com> | 2021-11-06 00:42:04 -0700 | 
|---|---|---|
| committer | xyz <gky44px1999@gmail.com> | 2021-11-06 00:42:04 -0700 | 
| commit | 1429d9bdf446c2d6272925a4dc029215a24ea81b (patch) | |
| tree | cb868c75bdf8d45e1a369c3e2c9010a9ddbf7736 /home | |
| parent | ea1d5f4388a793ea1c1c1d13b978fe7881147789 (diff) | |
use printf %q
Diffstat (limited to 'home')
| -rw-r--r-- | home/xyz/.bashrc | 8 | ||||
| -rwxr-xr-x | home/xyz/.config/nsxiv/exec/key-handler | 2 | 
2 files changed, 5 insertions, 5 deletions
| diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index 1812f253..070f969c 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}))  } diff --git a/home/xyz/.config/nsxiv/exec/key-handler b/home/xyz/.config/nsxiv/exec/key-handler index 80dd82f0..cfac0301 100755 --- a/home/xyz/.config/nsxiv/exec/key-handler +++ b/home/xyz/.config/nsxiv/exec/key-handler @@ -59,6 +59,6 @@ case "$1" in  	"p") tr '\n' '\0' | xargs -0 sh -c 'convert "$@" $(time.uuid).pdf' shell ;;  	"r") rotate ;;  	"w") tr '\n' '\0' | xargs -0 shufwall ;; -	"y") tr '\n' '\0' | xargs -0 realpath | xsel -b ;; +	"y") tr '\n' '\0' | xargs -0 realpath | tr '\n' '\0' | xargs -0 printf '%q ' | xsel -ib ;;  esac | 
