Reputation: 787
I'm using the zshell for macOS Catalina (10.15.6). The book "Learning Shell Scripting With Zsh" describes an executable command named prompt
, usable in such forms as:
$ prompt -p
$ prompt -h
$ prompt <theme_name>
$ prompt adam1 red yellow magenta
But zsh report "command not found: prompt".
How do I obtain that command, or an equivalent one.
(Everywhere I've tried to search about this just gives me links to places explaining how to set the zsh prompt, with all the usual escape sequences, "$..." symbols, etc.)
Upvotes: 3
Views: 1797
Reputation:
From 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
So, to get the prompt
command, you can just run
$ autoload -U promptinit
$ promptinit
Upvotes: 3