diff options
author | 林千里 <lincheney@gmail.com> | 2020-12-23 16:38:37 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-23 14:38:37 +0900 |
commit | e9bc7331bde238e84f24b76ebb1f5e18799b15c4 (patch) | |
tree | f85d8301d0a60addec5e1b6f36f688c0e32cd2ea /shell | |
parent | 797dd7c44933417f38ff81f69b9109386a0bf617 (diff) |
[zsh] Use shell redirection (#2281)
zsh sends SIGCONT when running fzf in a pipe in certain cases,
causing mouse mode to become disabled
Fix #2101
Diffstat (limited to 'shell')
-rw-r--r-- | shell/key-bindings.zsh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh index b55c4f4f..f7b89e71 100644 --- a/shell/key-bindings.zsh +++ b/shell/key-bindings.zsh @@ -83,7 +83,7 @@ fzf-cd-widget() { local 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-"}" setopt localoptions pipefail no_aliases 2> /dev/null - local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m)" + local dir="$(FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m < <(eval "$cmd") )" if [[ -z "$dir" ]]; then zle redisplay return 0 @@ -107,8 +107,10 @@ bindkey '\ec' fzf-cd-widget fzf-history-widget() { local selected num setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2> /dev/null - selected=( $(fc -rl 1 | perl -ne 'print if !$seen{(/^\s*[0-9]+\**\s+(.*)/, $1)}++' | - FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) ) + selected=( $( + FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd) < <( + fc -rl 1 | perl -ne 'print if !$seen{(/^\s*[0-9]+\**\s+(.*)/, $1)}++' + ) ) ) local ret=$? if [ -n "$selected" ]; then num=$selected[1] |