Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PS1 corrupted through "su"
- X-seq: zsh-users 2820
- From: John Galbraith <john@xxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: PS1 corrupted through "su"
- Date: Mon, 3 Jan 2000 10:25:56 -0700 (MST)
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
I have been dabbling with zsh, and I put some color in my prompt. This is
the relevant init stuff:
red="$(echo -n '%{[31m%}')"
cyan="$(echo -n '%{[36m%}')"
yellow="$(echo -n '%{[33m%}')"
normal="$(echo -n '%{[0m%}')"
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author