在zsh下获得命令找不到的工作


14

我试图让command-not-foundUbuntu下的功能在zsh下工作,但是没有运气:

➜  ~  pdfunite
zsh: command not found: pdfunite
➜  ~  bash
u@ub:~$ pdfunite
The program 'pdfunite' is currently not installed.  You can install it by typing:
sudo apt-get install poppler-utils

有谁知道是否有支持zsh的软件包?

谢谢。

Answers:


13

您必须在.zshrc中提供它:

if [[ -s '/etc/zsh_command_not_found' ]]; then
  source '/etc/zsh_command_not_found'
fi

该脚本是命令not-found的一部分

$ apt-cache search zsh_command_not_found
> command-not-found: /etc/zsh_command_not_found
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.