From 2bed7d370e3ff654542aec0e9ad698dac64f244b Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 19 Sep 2023 13:39:57 +0900 Subject: [shell] Use --scheme=path when appropriate Without the option, you may get suboptimal results if you have many paths with spaces in their names. e.g. https://github.com/junegunn/fzf/issues/2909#issuecomment-1207690770 Close #3433 --- shell/key-bindings.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell/key-bindings.bash') diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index 03089d42..98273b81 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -19,7 +19,7 @@ __fzf_select__() { -o -type f -print \ -o -type d -print \ -o -type l -print 2> /dev/null | cut -b3-"}" - opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} -m" + opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse --scheme=path ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} -m" eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) "$@" | while read -r item; do @@ -44,7 +44,7 @@ __fzf_cd__() { local cmd opts dir cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ -o -type d -print 2> /dev/null | cut -b3-"}" - opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-} +m" + opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse --scheme=path ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-} +m" dir=$(set +o pipefail; eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd)) && printf 'builtin cd -- %q' "$dir" } -- cgit v1.2.3