I could reduce the test case to:
And then sourcing it in an interactive shell.
ie. as long as two commands are run, it aborts.
This happens only when executing more than one command at once in an
interactive shell. This also reproduces the issue when run in an
echo a; echo b
The issue is that jobs that have terminated may still be in foreground.
This is fixed by putting them in the background when we're notified
about a process status change:
Thanks for investigating!