Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: regarding login prompt



Peter Stephenson <pws@xxxxxxx> writes:
> arnuld wrote:
>> how can i have a prompt like "[arnuld@arch ~] $ " in ZSH ?
>
> See PROMPT EXPANSION in the zshmisc manual page.  The simplest answer
> is
>
> PS1='[%n%m %~]%# '
>
> but note (i) as I've written it you get a "%" rather than a "$", which
> is the zsh convention (ii) this will show the entire directory path
> with substitution and you might want e.g. only the last few segments.
> The manual will help you tailor it further.

OT: Out of interest, why is it that zsh uses the % by convention? It
seems (as a relative newcomer) to be more rooted in the bourne shell
tradition, yet the % has historically been used by csh.

I'm sure there is some history here that I'm not aware of. Sorry if this
is a FAQ.

Boyd



Messages sorted by: Reverse Date, Date, Thread, Author