Skip to content
Myr

[fzf-tmux] Fix zoomed pane handling in popup mode (#2054)

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

When called with popup options, do not move to temp window.

authored by karasu · committed by GitHub · parent 97a725f · Browse files · 1 file+5 added−5 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+5 added−5 removed

  • other:+5 added−5 removed

1 file+5 added−5 removed

modified:bin/fzf-tmux+5 added-5 removed
136 unmodified lines
137138# --height option is not allowed139args=("--no-height" "${args[@]}")140141# Handle zoomed tmux pane by moving it to a temp window142if tmux list-panes -F '#F' | grep -q Z; then143 zoomed=1141# 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; 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_window147fi
13 unmodified lines
161 if [[ "${#tmux_win_opts[@]}" -gt 0 ]]; then162 eval "tmux ${tmux_win_opts[@]}"163 fi164165 # Remove temp window if we were zoomed166 if [[ -n "$zoomed" ]]; then165 # Remove temp window if we were zoomed without popup options166 if [[ -n "$zoomed_without_popup" ]]; then167 tmux display-message -p "#{window_id}" > /dev/null168 tmux swap-pane -t $original_window \; \169 select-window -t $original_window \; \170 kill-window -t $tmp_window \; \
66 unmodified lines