mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-25 22:27:41 +00:00
[fzf-tmux] Apply environment variables
This commit is contained in:
parent
2b8a1c0d70
commit
c22e729d9c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user