Skip to content

Commit 18824d4

Browse files
committed
Use zsh-async 1.8.3
1 parent 935a911 commit 18824d4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/async.zsh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
#
44
# zsh-async
55
#
6-
# version: 1.8.0
6+
# version: 1.8.3
77
# author: Mathias Fredriksson
88
# url: https://github.com/mafredri/zsh-async
99
#
1010

11-
typeset -g ASYNC_VERSION=1.8.0
11+
typeset -g ASYNC_VERSION=1.8.3
1212
# Produce debug output from zsh-async when set to 1.
1313
typeset -g ASYNC_DEBUG=${ASYNC_DEBUG:-0}
1414

@@ -563,10 +563,18 @@ async_start_worker() {
563563
fi
564564
fi
565565

566-
zpty -b $worker _async_worker -p $$ $args || {
566+
# Workaround for stderr in the main shell sometimes (incorrectly) being
567+
# reassigned to /dev/null by the reassignment done inside the async
568+
# worker.
569+
# See https://github.com/mafredri/zsh-async/issues/35.
570+
integer errfd
571+
exec {errfd}>&2
572+
zpty -b $worker _async_worker -p $$ $args 2>&$errfd || {
573+
exec {errfd}>& -
567574
async_stop_worker $worker
568575
return 1
569576
}
577+
exec {errfd}>& -
570578

571579
# Re-enable it if it was enabled, for debugging.
572580
(( has_xtrace )) && setopt xtrace

0 commit comments

Comments
 (0)