mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-22 12:55:17 +00:00
Use absolute path of fzf when splitting tmux window
This commit is contained in:
parent
c111af0ed2
commit
f7b52d2541
10
bin/fzf-tmux
10
bin/fzf-tmux
@ -50,13 +50,19 @@ cleanup() {
|
||||
}
|
||||
trap cleanup EXIT SIGINT SIGTERM
|
||||
|
||||
fail() {
|
||||
>&2 echo "$1"
|
||||
exit 1
|
||||
}
|
||||
fzf=$(which fzf 2> /dev/null) || fail "fzf executable not found"
|
||||
|
||||
mkfifo $fifo2
|
||||
mkfifo $fifo3
|
||||
if [ -t 0 ]; then
|
||||
tmux split-window $opt 'bash -c "fzf '"$fzf_args"' > '$fifo2'; echo \$? > '$fifo3'"'
|
||||
tmux split-window $opt 'sh -c "'$fzf' '"$fzf_args"' > '$fifo2'; echo \$? > '$fifo3'"'
|
||||
else
|
||||
mkfifo $fifo1
|
||||
tmux split-window $opt 'bash -c "fzf '"$fzf_args"' < '$fifo1' > '$fifo2'; echo \$? > '$fifo3'"'
|
||||
tmux split-window $opt 'sh -c "'$fzf' '"$fzf_args"' < '$fifo1' > '$fifo2'; echo \$? > '$fifo3'"'
|
||||
cat <&0 > $fifo1 &
|
||||
fi
|
||||
cat $fifo2
|
||||
|
Loading…
Reference in New Issue
Block a user