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
[bug] ERR trap is not inherited into command substitution under set -E (errtrace) #1133
[bug] ERR trap is not inherited into command substitution under set -E (errtrace)
set -E;trap'echo ERR-IN' ERR; x=$(false;echo incmd);echo"x=$x"# GNU bash 5.3.20: x=ERR-IN# incmd (the ERR trap fires inside the command substitution and is captured)# rubash / niu: x=incmd (no ERR-IN)
Expected (GNU bash 5.3.20): x contains ERR-IN followed by incmd.
Actual (rubash): x contains only incmd.
Inheritance into functions and ( ) subshells works correctly in rubash; only $( ) drops the ERR trap, so errtrace-based error handling silently stops working exactly where commands are captured.
Env: rubash master 493ebb2 / niubash 1.4.4 (niu, master 953f513, embeds rubash 493ebb2), Linux x86_64, GNU bash 5.3.20 x86_64-pc-linux-gnu as oracle. Also reproduces in niu (same engine).
Activity
caomengxuan666 commentedon Oct 23, 2026
FIXED-BY-#1181 — verified on master (263ce53f). Commit 7a10389.
set -E; trap 'echo ERR-IN' ERR; x=$(false; echo incmd); echo "x=$x"→x=ERR-IN\nincmd, identical to GNU 5.3.20.