这似乎是因为
/etc/zsh_command_not_found
使用
/usr/lib/command-not-found
并带有
--no-failure-msg
选项:
% cat /etc/zsh_command_not_found
# (c) Zygmunt Krynicki 2007,
# Licensed under GPL, see COPYING for the whole text
#
# This script will look-up command in the database and suggest
# installation of packages available from the repository
if [[ -x /usr/lib/command-not-found ]] ; then
if (( ! ${+functions[command_not_found_handler]} )) ; then
function command_not_found_handler {
[[ -x /usr/lib/command-not-found ]] || return 1
/usr/lib/command-not-found --no-failure-msg -- ${1+"$1"} && :
}
fi
fi
哪里
% /usr/lib/command-not-found --help
Usage: command-not-found [options] <command-name>
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-d DATA_DIR, --data-dir=DATA_DIR
use this path to locate data fields
--ignore-installed, --ignore-installed
ignore local binaries and display the available
packages
--no-failure-msg don't print '<command-name>: command not found'
如果你想显示这条消息,你可以将
zsh_command_not_found
脚本复制到本地,编辑它以删除该选项,并代替源代码使用
那个。