diff --git a/bin/fzf-tmux b/bin/fzf-tmux index ab1c52e..290ce87 100755 --- a/bin/fzf-tmux +++ b/bin/fzf-tmux @@ -130,7 +130,7 @@ while [[ $# -gt 0 ]]; do [[ -n "$skip" ]] && args+=("$arg") done -if [[ -z "$TMUX" || "$opt" =~ ^-h && "$columns" -le 40 || ! "$opt" =~ ^-h && "$lines" -le 15 ]]; then +if [[ -z "$TMUX" ]]; then "$fzf" "${args[@]}" exit $? fi @@ -222,14 +222,14 @@ if [[ -n "$term" ]] || [[ -t 0 ]]; then TMUX=$(echo $TMUX | cut -d , -f 1,2) tmux set-window-option synchronize-panes off \;\ set-window-option remain-on-exit off \;\ split-window $opt "${tmux_args[@]}" "$envs bash -c 'cd $(printf %q "$PWD"); exec -a fzf bash $argsf'" $swap \ - > /dev/null 2>&1 + > /dev/null 2>&1 || { "$fzf" "${args[@]}"; exit $?; } else mkfifo $fifo1 cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; echo \$? > $fifo3 $close" >> $argsf TMUX=$(echo $TMUX | cut -d , -f 1,2) tmux set-window-option synchronize-panes off \;\ set-window-option remain-on-exit off \;\ split-window $opt "${tmux_args[@]}" "$envs bash -c 'exec -a fzf bash $argsf'" $swap \ - > /dev/null 2>&1 + > /dev/null 2>&1 || { "$fzf" "${args[@]}"; exit $?; } cat <&0 > $fifo1 & fi cat $fifo2 diff --git a/shell/completion.bash b/shell/completion.bash index 377afe5..2aec1d6 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -37,7 +37,7 @@ bind '"\e[0n": redraw-current-line' __fzf_comprun() { if [ "$(type -t _fzf_comprun 2>&1)" = function ]; then _fzf_comprun "$@" - elif [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] || [ -n "$FZF_TMUX_OPTS" ]; }; then + elif [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "$FZF_TMUX_OPTS" ]; }; then shift fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- "$@" else diff --git a/shell/completion.zsh b/shell/completion.zsh index e791b3a..4c7922e 100644 --- a/shell/completion.zsh +++ b/shell/completion.zsh @@ -99,7 +99,7 @@ fi __fzf_comprun() { if [[ "$(type _fzf_comprun 2>&1)" =~ function ]]; then _fzf_comprun "$@" - elif [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] || [ -n "$FZF_TMUX_OPTS" ]; }; then + elif [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "$FZF_TMUX_OPTS" ]; }; then shift fzf-tmux ${(Q)${(Z+n+)FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}}} -- "$@" else diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index a0b9eae..e157b07 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -27,7 +27,7 @@ __fzf_select__() { if [[ $- =~ i ]]; then __fzfcmd() { - [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] || [ -n "$FZF_TMUX_OPTS" ]; } && + [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "$FZF_TMUX_OPTS" ]; } && echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf" } diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh index f8cb782..1960892 100644 --- a/shell/key-bindings.zsh +++ b/shell/key-bindings.zsh @@ -54,7 +54,7 @@ __fsel() { } __fzfcmd() { - [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] || [ -n "$FZF_TMUX_OPTS" ]; } && + [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "$FZF_TMUX_OPTS" ]; } && echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf" } diff --git a/test/test_go.rb b/test/test_go.rb index 108b6eb..420af34 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -2036,7 +2036,6 @@ module CompletionTest tmux.send_keys 'C-c' # FZF_TMUX=1 - skip 'screen size too small' if `tput lines`.to_i < 15 new_shell tmux.focus tmux.send_keys 'unset FZFFOOBR**', :Tab