From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26448 invoked from network); 3 Jan 2000 17:26:00 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Jan 2000 17:26:00 -0000 Received: (qmail 7903 invoked by alias); 3 Jan 2000 17:25:39 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2820 Received: (qmail 7896 invoked from network); 3 Jan 2000 17:25:33 -0000 From: John Galbraith Date: Mon, 3 Jan 2000 10:25:56 -0700 (MST) To: zsh-users@sunsite.auc.dk Subject: PS1 corrupted through "su" X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14448.55754.322294.62194@bartok.lanl.gov> Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII I have been dabbling with zsh, and I put some color in my prompt. This is the relevant init stuff: red="$(echo -n '%{%}')" cyan="$(echo -n '%{%}')" yellow="$(echo -n '%{%}')" normal="$(echo -n '%{%}')" export PS1="%(?.${yellow}.${red})%~%(!.${red}#.${cyan}%%)${normal} " This works great, until I su root. As my normal user, I get color and everything looks like it should. It looks like /usr/local% ^yellow ^cyan When I su, the prompt turns to %(?.%{%}.%{%})%~%(!.%{%}#.%{%}%%)%{%} ^yel ^red ^cyan ^ normal where I have marked the spots where the gibberish changes colors. It appears that the color change commands are interpreted at the wrong time. If I type "echo $PS1", I get the same thing. If I then start a new shell as root (by typing "zsh"), things work as expected. Why doesn't PS1 make it through the su? How do I get it to work, without having to start up a new shell? Thanks, John