summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorsolarizedalias <60473183+solarizedalias@users.noreply.github.com>2021-03-08 12:44:36 +0900
committerGitHub <noreply@github.com>2021-03-08 12:44:36 +0900
commit489b16efce5249d172f965046f229cca4c836aa7 (patch)
tree589b7d70e9bc9eb21445d76f58fd06fcf7fc8ad8 /bin
parentb82c1693c097a53e66ed27dd94d1d0bd9d974d2e (diff)
[fzf-tmux] Adapt to tmux latest changes (#2379)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fzf-tmux11
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/fzf-tmux b/bin/fzf-tmux
index 9d599947..8a9c2d57 100755
--- a/bin/fzf-tmux
+++ b/bin/fzf-tmux
@@ -204,7 +204,16 @@ if [[ "$opt" =~ "-K -E" ]]; then
cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; out=\$? $close; exit \$out" >> $argsf
cat <&0 > $fifo1 &
fi
- tmux popup -d "$PWD" "${tmux_args[@]}" $opt -R "bash $argsf" > /dev/null 2>&1
+
+ # tmux dropped the support for `-K`, `-R` to popup command
+ # TODO: We can remove this once tmux 3.2 is released
+ if [[ ! "$(tmux popup --help 2>&1)" =~ '-R shell-command' ]]; then
+ opt="${opt/-K/}"
+ else
+ opt="${opt} -R"
+ fi
+
+ tmux popup -d "$PWD" "${tmux_args[@]}" $opt "bash $argsf" > /dev/null 2>&1
exit $?
fi