zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-users@sunsite.auc.dk, Oliver Grimm <grimm@particle.phys.ethz.ch>
Subject: Re: PROMPT
Date: Thu, 17 Jun 1999 17:20:48 +0200	[thread overview]
Message-ID: <9906171520.AA21502@ibmth.df.unipi.it> (raw)
In-Reply-To: "Oliver Grimm"'s message of "Thu, 17 Jun 1999 17:32:41 DFT." <Pine.LNX.4.10.9906171727180.11755-100000@ihp-pc7.ethz.ch>

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@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


  reply	other threads:[~1999-06-17 15:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-16  9:27 PROMPT Oliver Grimm
1999-06-16 14:33 ` PROMPT Larry P. Schrof
1999-06-16 15:42 ` PROMPT Bart Schaefer
1999-06-17 15:32   ` PROMPT Oliver Grimm
1999-06-17 15:20     ` Peter Stephenson [this message]
1999-06-17 16:42       ` PROMPT Bart Schaefer
2005-02-24 19:30 prompt Joel David Elkins
2005-02-27 16:47 ` prompt William H. Magill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9906171520.AA21502@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=grimm@particle.phys.ethz.ch \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).