summaryrefslogtreecommitdiffstats
path: root/bin/fzf-tmux
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2020-04-01 23:43:35 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2020-04-03 13:23:15 +0900
commit540bfd7a72c050dd2f47fe1f944039d7b416c45e (patch)
tree1c461462e7fa6926c42c1fdb7f9da2ff101f599b /bin/fzf-tmux
parent8fbed2b13ab1952eaebc9ebafc916436f818ec4a (diff)
[fzf-tmux] Fall back to plain fzf when split failed
Diffstat (limited to 'bin/fzf-tmux')
-rwxr-xr-xbin/fzf-tmux6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/fzf-tmux b/bin/fzf-tmux
index ab1c52eb..290ce87e 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