Skip to content
Myr

[fzf-tmux] Restore tmux window options (#1272)

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

Restore the original values of 'remain-on-exit' and 'synchronize-panes' options when exiting 'fzf-tmux'.

authored by Heinrich Kruger · committed by Junegunn Choi · parent 87504a5 · Browse files · 1 file+7 added−0 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+7 added−0 removed

  • other:+7 added−0 removed

1 file+7 added−0 removed

modified:bin/fzf-tmux+7 added
134 unmodified lines
135fifo3="${TMPDIR:-/tmp}/fzf-fifo3-$id"136cleanup() {137 \rm -f $argsf $fifo1 $fifo2 $fifo3138139 # Restore tmux window options140 if [[ "${#tmux_win_opts[@]}" -gt 0 ]]; then141 eval "tmux ${tmux_win_opts[@]}"142 fi143144 # Remove temp window if we were zoomed145 if [[ -n "$zoomed" ]]; then146 tmux display-message -p "#{window_id}" > /dev/null147 tmux swap-pane -t $original_window \; \
30 unmodified lines
178pppid=$$179echo -n "trap 'kill -SIGUSR1 -$pppid' EXIT SIGINT SIGTERM;" > $argsf180close="; trap - EXIT SIGINT SIGTERM $close"181182tmux_win_opts=( $(tmux show-window-options remain-on-exit \; show-window-options synchronize-panes | sed 's/^/set-window-option /; s/$/ \\;/') )183184if [[ -n "$term" ]] || [[ -t 0 ]]; then185 cat <<< "\"$fzf\" $opts > $fifo2; echo \$? > $fifo3 $close" >> $argsf186 TMUX=$(echo $TMUX | cut -d , -f 1,2) tmux set-window-option synchronize-panes off \;\187 set-window-option remain-on-exit off \;\
14 unmodified lines