(from #bash on freenode) Running a command that is not found in the background with a handler using command substitution kills the shell, or the whole session.
Here is a test case: $ ( bash -ci 'command_not_found_handle () { printf "$(true)"; }; nonexistingcommand &') [1] 4696 $ bash: child setpgid (4697 to 4687): Operation not permitted it will sometimes also exit the outer shell, closing the terminal. The following reproducer always exit the outer shell (the handle in this shell, and the options set don't matter): $ (bash -ci 'command_not_founhandle () (:); nonexistingcommand &' ) I can reproduce this with 4.3rc1