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

Re: regarding login prompt

arnuld wrote:
> i am a BASH user who is interested in using ZSH as my daily routine
> shell. this is from my "~/.bashrc"
> PS1='[\u@\h \W]\$ '
> and my BASH prompt says:  "[arnuld@arch ~] $ "
> so i put that PS1 entry into my "~/.zshrc" file but when i login into
> ZSH i see that prompt is simply the same as the PS1 entry  and not
> like "arnuld@xxxxxxxx"
> 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.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070

To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview

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