Fix tools using fifos for OpenBSD
Without these changes, kak would hang on the corresponding commands, displaying a 'waiting for shell command to finish' message.
This commit is contained in:
parent
09e1ec97a9
commit
009eb80ca0
|
@ -36,7 +36,7 @@ The syntaxic errors detected during parsing are shown when auto-diagnostics are
|
||||||
# not hang while clang is running. As completions references a cursor
|
# not hang while clang is running. As completions references a cursor
|
||||||
# position and a buffer timestamp, only valid completions should be
|
# position and a buffer timestamp, only valid completions should be
|
||||||
# displayed.
|
# displayed.
|
||||||
(
|
{(
|
||||||
case ${kak_opt_filetype} in
|
case ${kak_opt_filetype} in
|
||||||
c) ft=c ;;
|
c) ft=c ;;
|
||||||
cpp) ft=c++ ;;
|
cpp) ft=c++ ;;
|
||||||
|
@ -100,7 +100,7 @@ The syntaxic errors detected during parsing are shown when auto-diagnostics are
|
||||||
|
|
||||||
printf %s\\n "set-option 'buffer=${kak_buffile}' clang_flags ${kak_timestamp} ${flags}
|
printf %s\\n "set-option 'buffer=${kak_buffile}' clang_flags ${kak_timestamp} ${flags}
|
||||||
set-option 'buffer=${kak_buffile}' clang_errors ${kak_timestamp} ${errors}" | kak -p ${kak_session}
|
set-option 'buffer=${kak_buffile}' clang_errors ${kak_timestamp} ${errors}" | kak -p ${kak_session}
|
||||||
) > /dev/null 2>&1 < /dev/null &
|
) & } > /dev/null 2>&1 < /dev/null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-
|
||||||
esac
|
esac
|
||||||
output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-git.XXXXXXXX)/fifo
|
output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-git.XXXXXXXX)/fifo
|
||||||
mkfifo ${output}
|
mkfifo ${output}
|
||||||
( git "$@" > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null &
|
( git "$@" > ${output} 2>&1 & ) > /dev/null 2>&1 < /dev/null
|
||||||
|
|
||||||
printf %s "evaluate-commands -try-client '$kak_opt_docsclient' %{
|
printf %s "evaluate-commands -try-client '$kak_opt_docsclient' %{
|
||||||
edit! -fifo ${output} *git*
|
edit! -fifo ${output} *git*
|
||||||
|
|
|
@ -11,9 +11,9 @@ All the optional arguments are forwarded to the grep utility} \
|
||||||
output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-grep.XXXXXXXX)/fifo
|
output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-grep.XXXXXXXX)/fifo
|
||||||
mkfifo ${output}
|
mkfifo ${output}
|
||||||
if [ $# -gt 0 ]; then
|
if [ $# -gt 0 ]; then
|
||||||
( ${kak_opt_grepcmd} "$@" | tr -d '\r' > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null &
|
( ${kak_opt_grepcmd} "$@" | tr -d '\r' > ${output} 2>&1 & ) > /dev/null 2>&1 < /dev/null
|
||||||
else
|
else
|
||||||
( ${kak_opt_grepcmd} "${kak_selection}" | tr -d '\r' > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null &
|
( ${kak_opt_grepcmd} "${kak_selection}" | tr -d '\r' > ${output} 2>&1 & ) > /dev/null 2>&1 < /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf %s\\n "evaluate-commands -try-client '$kak_opt_toolsclient' %{
|
printf %s\\n "evaluate-commands -try-client '$kak_opt_toolsclient' %{
|
||||||
|
|
|
@ -28,7 +28,7 @@ define-command lint -docstring 'Parse the current buffer with a linter' %{
|
||||||
hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r '$dir' } }
|
hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r '$dir' } }
|
||||||
}"
|
}"
|
||||||
|
|
||||||
{ # do the parsing in the background and when ready send to the session
|
{{ # do the parsing in the background and when ready send to the session
|
||||||
|
|
||||||
eval "$kak_opt_lintcmd '$dir'/${filename}" | sort -t: -k2,2 -n > "$dir"/stderr
|
eval "$kak_opt_lintcmd '$dir'/${filename}" | sort -t: -k2,2 -n > "$dir"/stderr
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ define-command lint -docstring 'Parse the current buffer with a linter' %{
|
||||||
}
|
}
|
||||||
' > "$dir"/fifo
|
' > "$dir"/fifo
|
||||||
|
|
||||||
} >/dev/null 2>&1 </dev/null &
|
} & } >/dev/null 2>&1 </dev/null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ All the optional arguments are forwarded to the make utility} \
|
||||||
make %{ evaluate-commands %sh{
|
make %{ evaluate-commands %sh{
|
||||||
output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-make.XXXXXXXX)/fifo
|
output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-make.XXXXXXXX)/fifo
|
||||||
mkfifo ${output}
|
mkfifo ${output}
|
||||||
( eval ${kak_opt_makecmd} "$@" > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null &
|
( eval ${kak_opt_makecmd} "$@" > ${output} 2>&1 & ) > /dev/null 2>&1 < /dev/null
|
||||||
|
|
||||||
printf %s\\n "evaluate-commands -try-client '$kak_opt_toolsclient' %{
|
printf %s\\n "evaluate-commands -try-client '$kak_opt_toolsclient' %{
|
||||||
edit! -fifo ${output} -scroll *make*
|
edit! -fifo ${output} -scroll *make*
|
||||||
|
|
|
@ -19,7 +19,7 @@ define-command jedi-complete -docstring "Complete the current selection" %{
|
||||||
evaluate-commands %sh{
|
evaluate-commands %sh{
|
||||||
dir=${kak_opt_jedi_tmp_dir}
|
dir=${kak_opt_jedi_tmp_dir}
|
||||||
printf %s\\n "evaluate-commands -draft %{ edit! -fifo ${dir}/fifo *jedi-output* }"
|
printf %s\\n "evaluate-commands -draft %{ edit! -fifo ${dir}/fifo *jedi-output* }"
|
||||||
(
|
{(
|
||||||
cd $(dirname ${kak_buffile})
|
cd $(dirname ${kak_buffile})
|
||||||
header="${kak_cursor_line}.${kak_cursor_column}@${kak_timestamp}"
|
header="${kak_cursor_line}.${kak_cursor_column}@${kak_timestamp}"
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ define-command jedi-complete -docstring "Complete the current selection" %{
|
||||||
)
|
)
|
||||||
printf %s\\n "evaluate-commands -client ${kak_client} %~echo completed; set-option %{buffer=${kak_buffile}} jedi_completions ${header} ${compl}~" | kak -p ${kak_session}
|
printf %s\\n "evaluate-commands -client ${kak_client} %~echo completed; set-option %{buffer=${kak_buffile}} jedi_completions ${header} ${compl}~" | kak -p ${kak_session}
|
||||||
rm -r ${dir}
|
rm -r ${dir}
|
||||||
) > /dev/null 2>&1 < /dev/null &
|
) & } > /dev/null 2>&1 < /dev/null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user