You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
interp: $- is unset, so it is empty and errors under set -u #1398
That combination is the awkward one: set -euo pipefail followed by anything that consults $- aborts. The common idioms are interactivity checks in shell rc files and libraries that save and restore options:
case$-in*i*) ... ;; esac# sees no flags at all
[[ $-==*e* ]] && restore_errexit=1
The interactivity check happens to reach the right answer today, since an empty $- contains no i either — but only by accident, and only while interp has no interactive mode.
$- should hold the single-letter names of the enabled options, which interp already tracks in posixOptsTable; note that pipefail has no letter there (), so it is -o-only in bash too and should be left out.
Reproduced on master at d6550df against bash 5.3.15 on darwin/arm64, found while measuring set for #1392.
Activity
interp: implement $-