From c22e729d9c8810f8c227b353367c3b60ae333ee0 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 9 Mar 2015 23:57:17 +0900 Subject: [PATCH] [fzf-tmux] Apply environment variables --- bin/fzf-tmux | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/fzf-tmux b/bin/fzf-tmux index 6b833db..0eb2e37 100755 --- a/bin/fzf-tmux +++ b/bin/fzf-tmux @@ -99,16 +99,17 @@ fail() { exit 1 } fzf=$(which fzf 2> /dev/null) || fail "fzf executable not found" +envs="FZF_DEFAULT_OPTS=$(printf %q "$FZF_DEFAULT_OPTS") FZF_DEFAULT_COMMAND=$(printf %q "$FZF_DEFAULT_COMMAND")" mkfifo $fifo2 mkfifo $fifo3 if [ -t 0 ]; then tmux set-window-option -q synchronize-panes off \;\ - split-window $opt 'sh -c "'$fzf' '"$fzf_args"' > '$fifo2'; echo \$? > '$fifo3' '"$close"'"' $swap + split-window $opt "$envs"' sh -c "'$fzf' '"$fzf_args"' > '$fifo2'; echo \$? > '$fifo3' '"$close"'"' $swap else mkfifo $fifo1 tmux set-window-option -q synchronize-panes off \;\ - split-window $opt 'sh -c "'$fzf' '"$fzf_args"' < '$fifo1' > '$fifo2'; echo \$? > '$fifo3' '"$close"'"' $swap + split-window $opt "$envs"' sh -c "'$fzf' '"$fzf_args"' < '$fifo1' > '$fifo2'; echo \$? > '$fifo3' '"$close"'"' $swap cat <&0 > $fifo1 & fi cat $fifo2