Skip to content
Myr

[fzf-tmux] Fall back to plain fzf when split failed

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 8fbed2b · Browse files · 6 files+7 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+7 added−8 removed

  • tests:+0 added−1 removed
  • other:+7 added−7 removed

6 files+7 added−8 removed

modified:bin/fzf-tmux+3 added-3 removed
128 unmodified lines
129 esac130 [[ -n "$skip" ]] && args+=("$arg")131done132133if [[ -z "$TMUX" || "$opt" =~ ^-h && "$columns" -le 40 || ! "$opt" =~ ^-h && "$lines" -le 15 ]]; then133if [[ -z "$TMUX" ]]; then134 "$fzf" "${args[@]}"135 exit $?136fi137
83 unmodified lines
221 cat <<< "\"$fzf\" $opts > $fifo2; echo \$? > $fifo3 $close" >> $argsf222 TMUX=$(echo $TMUX | cut -d , -f 1,2) tmux set-window-option synchronize-panes off \;\223 set-window-option remain-on-exit off \;\224 split-window $opt "${tmux_args[@]}" "$envs bash -c 'cd $(printf %q "$PWD"); exec -a fzf bash $argsf'" $swap \225 > /dev/null 2>&1225 > /dev/null 2>&1 || { "$fzf" "${args[@]}"; exit $?; }226else227 mkfifo $fifo1228 cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; echo \$? > $fifo3 $close" >> $argsf229 TMUX=$(echo $TMUX | cut -d , -f 1,2) tmux set-window-option synchronize-panes off \;\230 set-window-option remain-on-exit off \;\231 split-window $opt "${tmux_args[@]}" "$envs bash -c 'exec -a fzf bash $argsf'" $swap \232 > /dev/null 2>&1232 > /dev/null 2>&1 || { "$fzf" "${args[@]}"; exit $?; }233 cat <&0 > $fifo1 &234fi235cat $fifo2236exit "$(cat $fifo3)"
modified:shell/completion.bash+1 added-1 removed
35 unmodified lines
3637__fzf_comprun() {38 if [ "$(type -t _fzf_comprun 2>&1)" = function ]; then39 _fzf_comprun "$@"40 elif [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] || [ -n "$FZF_TMUX_OPTS" ]; }; then40 elif [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "$FZF_TMUX_OPTS" ]; }; then41 shift42 fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- "$@"43 else44 shift
321 unmodified lines
modified:shell/completion.zsh+1 added-1 removed
97 unmodified lines
9899__fzf_comprun() {100 if [[ "$(type _fzf_comprun 2>&1)" =~ function ]]; then101 _fzf_comprun "$@"102 elif [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] || [ -n "$FZF_TMUX_OPTS" ]; }; then102 elif [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "$FZF_TMUX_OPTS" ]; }; then103 shift104 fzf-tmux ${(Q)${(Z+n+)FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}}} -- "$@"105 else106 shift
207 unmodified lines
modified:shell/key-bindings.bash+1 added-1 removed
modified:shell/key-bindings.zsh+1 added-1 removed
52 unmodified lines
53 return $ret54}5556__fzfcmd() {57 [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] || [ -n "$FZF_TMUX_OPTS" ]; } &&57 [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "$FZF_TMUX_OPTS" ]; } &&58 echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf"59}6061fzf-file-widget() {
60 unmodified lines
modified:test/test_go.rb-1 removed
2034 unmodified lines
2035 tmux.until { |lines| lines[-1].include? 'unset FZFFOOBAR' }2036 tmux.send_keys 'C-c'20372038 # FZF_TMUX=12039 skip 'screen size too small' if `tput lines`.to_i < 152039 new_shell2040 tmux.focus2041 tmux.send_keys 'unset FZFFOOBR**', :Tab2042 tmux.until { |lines| lines.match_count == 1 }
171 unmodified lines