From 01cf01e084e25817b1eaf6abb694659ef212571d Mon Sep 17 00:00:00 2001 From: karasu Date: Sat, 23 May 2020 20:47:43 +0900 Subject: [PATCH] [fzf-tmux] Fix zoomed pane handling in popup mode (#2054) When called with popup options, do not move to temp window. --- bin/fzf-tmux | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/fzf-tmux b/bin/fzf-tmux index 4b3e497f..a65acc2d 100755 --- a/bin/fzf-tmux +++ b/bin/fzf-tmux @@ -138,9 +138,9 @@ fi # --height option is not allowed args=("--no-height" "${args[@]}") -# Handle zoomed tmux pane by moving it to a temp window -if tmux list-panes -F '#F' | grep -q Z; then - zoomed=1 +# Handle zoomed tmux pane without popup options by moving it to a temp window +if [[ ! "$opt" =~ "-K -E" ]] && tmux list-panes -F '#F' | grep -q Z; then + zoomed_without_popup=1 original_window=$(tmux display-message -p "#{window_id}") 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'") tmux swap-pane -t $tmp_window \; select-window -t $tmp_window @@ -162,8 +162,8 @@ cleanup() { eval "tmux ${tmux_win_opts[@]}" fi - # Remove temp window if we were zoomed - if [[ -n "$zoomed" ]]; then + # Remove temp window if we were zoomed without popup options + if [[ -n "$zoomed_without_popup" ]]; then tmux display-message -p "#{window_id}" > /dev/null tmux swap-pane -t $original_window \; \ select-window -t $original_window \; \