You are not logged in.
Pages: 1
my ~/.zshrc is
PS1='%B%F{black}[%b%F{yellow}%n%B@%U%M%u%f%b:%B%F{red}%~%F{black}]%f%b$ '
and my /root/.zshrc is
PS1='%B%F{black}[%b%f%K{red}%F{white}%n%B%F{yellow}@%U%M%u%f%b:%B%F{red}%~%F{black}]%f%b$ '
when I am in the terminal and type su it doesn't change the PS1 colors or anything for root, how can I correct this?
Offline
Hi
You will want to use
su -
or
su --login
to make it a login shell. From the manpage here http://linux.die.net/man/1/su
you can also find the man page with
man su
hope this helps!
Offline
I have tried those, unfortunately it doesn't change anything
Offline
bump
Offline
Offline
urxvt, zsh
Offline
no, what does the /etc/passwd say about it?
Last edited by caxap (2011-04-02 08:36:38)
Offline
I think i see what caxap is getting at...
root does not use zsh by default. You will have to pass the -s flag to su and specify you want to use zsh.
su -s /bin/zsh -
example
andrew@myth ~ $ cat .zshrc
# Created by newuser for 4.3.11
PS1='%B%F{black}[%b%F{yellow}%n%B@%U%M%u%f%b:%B%F{red}%~%F{black}]%f%b$ '
andrew@myth ~ $ zsh --login
Q: Why do the police always travel in threes?
A: One to do the reading, one to do the writing, and the other keeps
an eye on the two intellectuals.
[andrew@myth:~]$ echo ${PS1}
%B%F{black}[%b%F{yellow}%n%B@%U%M%u%f%b:%B%F{red}%~%F{black}]%f%b$
[andrew@myth:~]$ su -s /bin/zsh -
Password:
At the source of every error which is blamed on the computer you will find
at least two human errors, including the error of blaming it on the computer.
[root@myth:~]$ cat .zshrc
PS1='%B%F{black}[%b%f%K{red}%F{white}%n%B%F{yellow}@%U%M%u%f%b:%B%F{red}%~%F{black}]%f%b$ '
[root@myth:~]$ echo ${PS1}
%B%F{black}[%b%f%K{red}%F{white}%n%B%F{yellow}@%U%M%u%f%b:%B%F{red}%~%F{black}]%f%b$
[root@myth:~]$
as an alternative, you can change root's default shell with .
usermod -s /bin/zsh root
Offline
Pages: 1