Is there a way to intercept the "command not found" error in ZSH? I've seen this is possible in bash apparently, but I couldn't find anything about doing it in zsh.
Zsh – How to Intercept ‘Command Not Found’ Error in Zsh
shelltrap:zsh
shelltrap:zsh
Is there a way to intercept the "command not found" error in ZSH? I've seen this is possible in bash apparently, but I couldn't find anything about doing it in zsh.
Best Answer
There is; it's the same as in bash, you make a function named
command_not_found_handler
. It'll be passed all the arguments that were given in the shell