1
0
Fork 0

runcoms: don't raise an error in zlogin when stderr is not a TTY (#1775)

The existing code in runcoms/zlogin results in `$?` being
equal to `1` when starting a login shell if stderr is not
a TTY. For example:

  zsh -l 2>/dev/null

When using a theme that displays error/success status of
the last command, the first prompt will show an error.

This commit fixes it so that error code is zero after
sourcing zlogin (unless something unexpected and bad happens).
pull/1781/head
Roman Perepelitsa 5 years ago committed by Kaleb Elwert
parent 7c94154dda
commit c6efe80152

@ -15,7 +15,7 @@
} &! } &!
# Execute code only if STDERR is bound to a TTY. # Execute code only if STDERR is bound to a TTY.
[[ -o INTERACTIVE && -t 2 ]] && { if [[ -o INTERACTIVE && -t 2 ]]; then
# Print a random, hopefully interesting, adage. # Print a random, hopefully interesting, adage.
if (( $+commands[fortune] )); then if (( $+commands[fortune] )); then
@ -23,4 +23,4 @@
print print
fi fi
} >&2 fi >&2

Loading…
Cancel
Save