Skip to content
Myr

[fzf-tmux] Remove code for tmux 3.2 beta compatibility

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 a8e7021 · Browse files · 1 file+4 added−12 removed
This commit

State

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

Diff stats

1 file+4 added−12 removed

  • other:+4 added−12 removed

1 file+4 added−12 removed

modified:bin/fzf-tmux+4 added-12 removed
56 unmodified lines
57 exit58 ;;59 -p*|-w*|-h*|-x*|-y*|-d*|-u*|-r*|-l*)60 if [[ "$arg" =~ ^-[pwhxy] ]]; then61 [[ "$opt" =~ "-K -E" ]] || opt="-K -E"61 [[ "$opt" =~ "-E" ]] || opt="-E"62 elif [[ "$arg" =~ ^.[lr] ]]; then63 opt="-h"64 if [[ "$arg" =~ ^.l ]]; then65 opt="$opt -d"
72 unmodified lines
138# --height option is not allowed. CTRL-Z is also disabled.139args=("${args[@]}" "--no-height" "--bind=ctrl-z:ignore")140141# Handle zoomed tmux pane without popup options by moving it to a temp window142if [[ ! "$opt" =~ "-K -E" ]] && tmux list-panes -F '#F' | grep -q Z; then142if [[ ! "$opt" =~ "-E" ]] && tmux list-panes -F '#F' | grep -q Z; then143 zoomed_without_popup=1144 original_window=$(tmux display-message -p "#{window_id}")145 tmp_window=$(tmux new-window -d -P -F "#{window_id}" "bash -c 'while :; do for c in \\| / - '\\;' do sleep 0.2; printf \"\\r\$c fzf-tmux is running\\r\"; done; done'")146 tmux swap-pane -t $tmp_window \; select-window -t $tmp_window
33 unmodified lines
180trap 'cleanup 1' SIGUSR1181trap 'cleanup' EXIT182183envs="export TERM=$TERM "184[[ "$opt" =~ "-K -E" ]] && FZF_DEFAULT_OPTS="--margin 0,1 $FZF_DEFAULT_OPTS"184[[ "$opt" =~ "-E" ]] && FZF_DEFAULT_OPTS="--margin 0,1 $FZF_DEFAULT_OPTS"185[[ -n "$FZF_DEFAULT_OPTS" ]] && envs="$envs FZF_DEFAULT_OPTS=$(printf %q "$FZF_DEFAULT_OPTS")"186[[ -n "$FZF_DEFAULT_COMMAND" ]] && envs="$envs FZF_DEFAULT_COMMAND=$(printf %q "$FZF_DEFAULT_COMMAND")"187echo "$envs;" > "$argsf"188
5 unmodified lines
194close="; trap - EXIT SIGINT SIGTERM $close"195196export TMUX=$(cut -d , -f 1,2 <<< "$TMUX")197mkfifo -m o+w $fifo2198if [[ "$opt" =~ "-K -E" ]]; then198if [[ "$opt" =~ "-E" ]]; then199 cat $fifo2 &200 if [[ -n "$term" ]] || [[ -t 0 ]]; then201 cat <<< "\"$fzf\" $opts > $fifo2; out=\$? $close; exit \$out" >> $argsf202 else
1 unmodified line
204 cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; out=\$? $close; exit \$out" >> $argsf205 cat <&0 > $fifo1 &206 fi207208 # tmux dropped the support for `-K`, `-R` to popup command209 # TODO: We can remove this once tmux 3.2 is released210 if [[ ! "$(tmux popup --help 2>&1)" =~ '-R shell-command' ]]; then211 opt="${opt/-K/}"212 else213 opt="${opt} -R"214 fi215208 tmux popup -d "$PWD" "${tmux_args[@]}" $opt "bash $argsf" > /dev/null 2>&1209 exit $?210fi211
14 unmodified lines