Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PROMPT
- X-seq: zsh-users 2395
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx, Oliver Grimm <grimm@xxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: PROMPT
- Date: Thu, 17 Jun 1999 17:20:48 +0200
- In-reply-to: "Oliver Grimm"'s message of "Thu, 17 Jun 1999 17:32:41 DFT." <Pine.LNX.4.10.9906171727180.11755-100000@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
Oliver Grimm wrote:
> The /etc/zshrc file sources /etc/profile, which contains the following:
>
> if test -z "$EMACS" ; then
> if [ -n "$ZSH_VERSION" ]; then
> precmd ()
> {
> if test "$UID" = 0; then
> PS1="%m:`pwd -r` # "
> else
> PS1="%n@%m:`pwd -r` > "
> fi
> }
> fi
> fi
>
> I wonder if this was intended by the designer of the profile ?
I can hardly believe it. The correct way of doing this, by the way, is
setopt promptsubst
PS1='%n@%m:`pwd -r`'
or if you insist on having the physical directory (the -r argument to pwd),
it might be better to have
setopt chaselinks
PS1='%n@%m:%/'
but using precmd() just to get the raw directory into the prompt is serious
overkill.
--
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
Messages sorted by:
Reverse Date,
Date,
Thread,
Author