我正在将zshell用于macOS Catalina(10.15.6)。《学习使用Zsh的Shell脚本》一书描述了名为的可执行命令prompt
,其使用方式如下:
$ prompt -p
$ prompt -h
$ prompt <theme_name>
$ prompt adam1 red yellow magenta
但是zsh报告“找不到命令:提示符”。
我如何获得该命令或等效命令。
(我尝试搜索的所有地方都向我提供了指向地方的链接,这些地方解释了如何设置zsh提示符,以及所有常见的转义序列,“ $ ...”符号等)。
来自man zshcontrib
:
PROMPT THEMES
Installation
You should make sure all the functions from the Functions/Prompts
directory of the source distribution are available; they all begin with
the string `prompt_' except for the special function`promptinit'. You
also need the `colors' and `add-zsh-hook' functions from Func-
tions/Misc. All these functions may already be installed on your sys-
tem; if not, you will need to find them and copy them. The directory
should appear as one of the elements of the fpath array (this should
already be the case if they were installed), and at least the function
promptinit should be autoloaded; it will autoload the rest. Finally,
to initialize the use of the system you need to call the promptinit
function. The following code in your .zshrc will arrange for this;
assume the functions are stored in the directory ~/myfns:
fpath=(~/myfns $fpath)
autoload -U promptinit
promptinit
因此,要获取prompt
命令,您只需运行
$ autoload -U promptinit
$ promptinit
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句