[fzf-tmux/vim] Fixes for fish (#204)
This commit is contained in:
parent
16ca9c688b
commit
917b1759b0
20
bin/fzf-tmux
20
bin/fzf-tmux
@ -100,13 +100,6 @@ cleanup() {
|
|||||||
}
|
}
|
||||||
trap cleanup EXIT SIGINT SIGTERM
|
trap cleanup EXIT SIGINT SIGTERM
|
||||||
|
|
||||||
# Build arguments to fzf
|
|
||||||
str=""
|
|
||||||
for arg in "${args[@]}"; do
|
|
||||||
str="$str \"${arg//\"/\\\"}\""
|
|
||||||
done
|
|
||||||
cat <<< "$str" > $argsf
|
|
||||||
|
|
||||||
fail() {
|
fail() {
|
||||||
>&2 echo "$1"
|
>&2 echo "$1"
|
||||||
exit 1
|
exit 1
|
||||||
@ -120,13 +113,22 @@ envs=""
|
|||||||
|
|
||||||
mkfifo $fifo2
|
mkfifo $fifo2
|
||||||
mkfifo $fifo3
|
mkfifo $fifo3
|
||||||
|
|
||||||
|
# Build arguments to fzf
|
||||||
|
opts=""
|
||||||
|
for arg in "${args[@]}"; do
|
||||||
|
opts="$opts \"${arg//\"/\\\"}\""
|
||||||
|
done
|
||||||
|
|
||||||
if [ -n "$term" -o -t 0 ]; then
|
if [ -n "$term" -o -t 0 ]; then
|
||||||
|
cat <<< "$fzf $opts > $fifo2; echo \$? > $fifo3 $close" > $argsf
|
||||||
tmux set-window-option -q synchronize-panes off \;\
|
tmux set-window-option -q synchronize-panes off \;\
|
||||||
split-window $opt "cd $(printf %q "$PWD");$envs"' bash -c "'$fzf' $(cat '$argsf') > '$fifo2'; echo \$? > '$fifo3' '"$close"'"' $swap
|
split-window $opt "cd $(printf %q "$PWD");$envs bash $argsf" $swap
|
||||||
else
|
else
|
||||||
mkfifo $fifo1
|
mkfifo $fifo1
|
||||||
|
cat <<< "$fzf $opts < $fifo1 > $fifo2; echo \$? > $fifo3 $close" > $argsf
|
||||||
tmux set-window-option -q synchronize-panes off \;\
|
tmux set-window-option -q synchronize-panes off \;\
|
||||||
split-window $opt "$envs"' bash -c "'$fzf' $(cat '$argsf') < '$fifo1' > '$fifo2'; echo \$? > '$fifo3' '"$close"'"' $swap
|
split-window $opt "$envs bash $argsf" $swap
|
||||||
cat <&0 > $fifo1 &
|
cat <&0 > $fifo1 &
|
||||||
fi
|
fi
|
||||||
cat $fifo2
|
cat $fifo2
|
||||||
|
@ -105,6 +105,9 @@ function! s:upgrade(dict)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fzf#run(...) abort
|
function! fzf#run(...) abort
|
||||||
|
try
|
||||||
|
let oshell = &shell
|
||||||
|
set shell=sh
|
||||||
if has('nvim') && bufexists('[FZF]')
|
if has('nvim') && bufexists('[FZF]')
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echomsg 'FZF is already running!'
|
echomsg 'FZF is already running!'
|
||||||
@ -149,6 +152,9 @@ function! fzf#run(...) abort
|
|||||||
finally
|
finally
|
||||||
call s:popd(dict)
|
call s:popd(dict)
|
||||||
endtry
|
endtry
|
||||||
|
finally
|
||||||
|
let &shell = oshell
|
||||||
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:present(dict, ...)
|
function! s:present(dict, ...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user