File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 159159set -e
160160
161161# Clean up named pipes on exit
162- id= $RANDOM
163- argsf=" ${TMPDIR :-/ tmp} /fzf- args- $id "
164- fifo1=" ${TMPDIR :-/ tmp} /fzf- fifo1- $id "
165- fifo2=" ${TMPDIR :-/ tmp} /fzf- fifo2- $id "
166- fifo3=" ${TMPDIR :-/ tmp} /fzf- fifo3- $id "
162+ tmpdir= $( mktemp -d " ${TMPDIR :-/ tmp} /fzf-tmux-XXXXXX " )
163+ argsf=" $tmpdir / args"
164+ fifo1=" $tmpdir / fifo1"
165+ fifo2=" $tmpdir / fifo2"
166+ fifo3=" $tmpdir / fifo3"
167167if tmux_win_opts=$( tmux show-options -p remain-on-exit \; show-options -p synchronize-panes 2> /dev/null) ; then
168168 tmux_win_opts=($( sed ' / off/d; s/synchronize-panes/set-option -p synchronize-panes/; s/remain-on-exit/set-option -p remain-on-exit/; s/$/ \\;/' <<< " $tmux_win_opts" ) )
169169 tmux_off_opts=' ; set-option -p synchronize-panes off ; set-option -p remain-on-exit off'
172172 tmux_off_opts=' ; set-window-option synchronize-panes off ; set-window-option remain-on-exit off'
173173fi
174174cleanup () {
175- \r m -f $argsf $fifo1 $fifo2 $fifo3
176-
175+ \r m -rf " $tmpdir "
177176 # Restore tmux window options
178177 if [[ ${# tmux_win_opts[@]} -gt 1 ]]; then
179178 eval " tmux ${tmux_win_opts[*]} "
@@ -196,7 +195,7 @@ cleanup() {
196195trap ' cleanup 1' SIGUSR1
197196trap ' cleanup' EXIT
198197
199- envs=" export TERM=$TERM "
198+ envs=" export TERM=$( printf %q " $ TERM" ) "
200199if [[ $opt =~ " -E" ]]; then
201200 if [[ $tmux_version == 3.2 ]]; then
202201 FZF_DEFAULT_OPTS=" --margin 0,1 $FZF_DEFAULT_OPTS "
You can’t perform that action at this time.
0 commit comments