How to disable install package prompt on command not found?

What is the proper way to disable prompt “The application %s is not installed. It may be found in the following packages:”?

Should I delete file /usr/share/zsh/functions/command-not-found.zsh
or make a local copy of /usr/share/zsh/manjaro-zsh-config and remove that section
or is there a way to disable it via ~/.zshrc (preferred) ?

I would like to get an error if I type a command that doesn’t exists without any suggestions, recommendations or corrections.

Thanks

That would be the prefered method. Then source your copy instead of the global file.

Thanks, I’ll do it this way for now

The reason I’m not happy with the solution are possible future updates of manjaro’s zsh config file. I would stuck with the version I’m copying from. Is there any (smart) way for overcoming the issue? :slight_smile:

I guess not. Manage it yourself, or let it be managed by Manjaro. Your choice.

You can unset the function in ~/.zshrc, after the Manjaro config is sourced.

# Use powerline
USE_POWERLINE="true"
# Source manjaro-zsh-configuration
if [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then
  source /usr/share/zsh/manjaro-zsh-config
fi
# Use manjaro zsh prompt
if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
  source /usr/share/zsh/manjaro-zsh-prompt
fi

unsetfunc command_not_found_handler
2 Likes

Brilliant, thank you very much! :slight_smile:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.