On Tue, Mar 10, 2020 at 06:37:24PM +0100, Phi Debian wrote: > In a nutshell to implement a function autoloading I want to plug into > command_not_found_handle(), but I need command_not_found_handle()be > evaluated in the shell context, not in a subshell.
You can't. Bash has already forked the subshell before searching for the command that's not found. The command_not_found_handle runs in the already existing subshell. > To demonstrate the bug, suffice to do this It's not a bug.