1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-09-21 11:00:08 +00:00

pull upstream changes from gitstatus

This commit is contained in:
romkatv 2019-10-12 15:03:01 +02:00
parent af2b394eb3
commit 3775ec7175

View file

@ -383,6 +383,7 @@ function gitstatus_start() {
$recurse_untracked_dirs) $recurse_untracked_dirs)
local cmd=" local cmd="
exec >&4
echo \$\$ echo \$\$
${(q)daemon} $daemon_args ${(q)daemon} $daemon_args
if [[ \$? != (0|10) && \$? -le 128 && -f ${(q)daemon}-static ]]; then if [[ \$? != (0|10) && \$? -le 128 && -f ${(q)daemon}-static ]]; then
@ -395,7 +396,7 @@ function gitstatus_start() {
# We use `zsh -c` instead of plain {} or () to work around bugs in zplug (it hangs on # We use `zsh -c` instead of plain {} or () to work around bugs in zplug (it hangs on
# startup). Double fork is to daemonize, and so is `setsid`. Note that on macOS `setsid` has # startup). Double fork is to daemonize, and so is `setsid`. Note that on macOS `setsid` has
# to be installed manually by running `brew install util-linux`. # to be installed manually by running `brew install util-linux`.
zsh -dfmxc $cmd <$req_fifo >$resp_fifo 2>$log_file 3<$lock_file &! zsh -dfmxc $cmd <$req_fifo >$log_file 2>&1 3<$lock_file 4>$resp_fifo &!
sysopen -w -o cloexec,sync -u req_fd $req_fifo sysopen -w -o cloexec,sync -u req_fd $req_fifo
sysopen -r -o cloexec -u resp_fd $resp_fifo sysopen -r -o cloexec -u resp_fd $resp_fifo
@ -405,7 +406,10 @@ function gitstatus_start() {
(( async )) && { (( async )) && {
daemon_pid=-1 daemon_pid=-1
} || { } || {
read -u $resp_fd daemon_pid local reply IFS=''
read -ru $resp_fd reply
[[ $reply == <1-> ]]
daemon_pid=reply
function _gitstatus_process_response_${name}() { function _gitstatus_process_response_${name}() {
local name=${${(%):-%N}#_gitstatus_process_response_} local name=${${(%):-%N}#_gitstatus_process_response_}
@ -418,7 +422,6 @@ function gitstatus_start() {
} }
zle -F $resp_fd _gitstatus_process_response_${name} zle -F $resp_fd _gitstatus_process_response_${name}
local reply IFS=''
read -r -d $'\x1e' -u $resp_fd -t $timeout reply read -r -d $'\x1e' -u $resp_fd -t $timeout reply
[[ $reply == $'hello\x1f0' ]] [[ $reply == $'hello\x1f0' ]]