From 3cf9ae04c7d8ed13906baea2d12258e44a94b306 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 4 Jun 2017 23:24:57 +0900 Subject: [PATCH] [fzf-tmux] Fix cleanup of temporary files Close #935 --- bin/fzf-tmux | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/fzf-tmux b/bin/fzf-tmux index b01d995d..5ec0dc4f 100755 --- a/bin/fzf-tmux +++ b/bin/fzf-tmux @@ -134,7 +134,7 @@ fifo1="${TMPDIR:-/tmp}/fzf-fifo1-$id" fifo2="${TMPDIR:-/tmp}/fzf-fifo2-$id" fifo3="${TMPDIR:-/tmp}/fzf-fifo3-$id" cleanup() { - rm -f $argsf $fifo1 $fifo2 $fifo3 + \rm -f $argsf $fifo1 $fifo2 $fifo3 # Remove temp window if we were zoomed if [[ -n "$zoomed" ]]; then @@ -150,6 +150,7 @@ cleanup() { fi } trap 'cleanup 1' SIGUSR1 +trap 'cleanup' EXIT envs="env TERM=$TERM " [[ -n "$FZF_DEFAULT_OPTS" ]] && envs="$envs FZF_DEFAULT_OPTS=$(printf %q "$FZF_DEFAULT_OPTS")" @@ -169,7 +170,7 @@ for arg in "${args[@]}"; do done pppid=$$ -trap_set="trap 'kill -SIGUSR1 $pppid' EXIT SIGINT SIGTERM" +trap_set="trap 'kill -SIGUSR1 -$pppid' EXIT SIGINT SIGTERM" trap_unset="trap - EXIT SIGINT SIGTERM" if [[ -n "$term" ]] || [[ -t 0 ]]; then