You are not logged in.

#1 2004-07-14 06:03:16

cs25x
Member
Registered: 2004-05-04
Posts: 150

zsh profile ~/.zshrc

I have a problem with zsh.
If i use zsh, login does not read /etc/profile.
If I use bash, it does.
Then if I fix this with ~/.zshrc, it doesnt set PS1 & PS2.

I know it is reading /etc/profile if I login using bash, because I put a couple of echo $PS1s in. But if I login using zsh as my shell, there are no echoed PS1s to be seen, and I get default values for the things I set in /etc/profile.

TIA


--(*(cs25x--));

Offline

#2 2004-07-14 10:03:22

dpb
Member
From: Cyperspace?
Registered: 2004-04-11
Posts: 231

Re: zsh profile ~/.zshrc

/etc/profile is a bash file, zsh doesn't use this.

Offline

#3 2004-07-14 12:48:53

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: zsh profile ~/.zshrc

Adding "source /etc/profile" or ". /etc/profile" to your ~/.zshrc probably fixes it.

Offline

#4 2004-07-14 21:38:04

cs25x
Member
Registered: 2004-05-04
Posts: 150

Re: zsh profile ~/.zshrc

i3839 : (
well, it did something, but not what I wanted. It ecohed the color control string for my user PS1 .
However it is a start, so I will go read manual.

Thanks.


--(*(cs25x--));

Offline

#5 2004-07-14 22:14:00

scottro
Member
From: NYC
Registered: 2002-10-11
Posts: 466
Website

Re: zsh profile ~/.zshrc

I found the easiest way was to simply add the rest of my PATH to it.  (As for PS1, I have a custom girlyman zsh prompt, that imitates Gentoo's colors--if you want it it's
PS1=$'%{e[1;32m%}%n@%{e[1;34m%}%m %{e[1;36m%}%1d %{e[1;36m%}%#%{e[0m%} '

)

Actually, the colors might be different, don't remember when I finally decided on a scheme that I liked.

Added a few minutes later--just took a look at the man page, and actually, it's supposed to source /etc/profile.  However, when I added that to .zshrc I got what you got, an odd looking prompt. I assume there's something in there I'm missing, but I'm too lazy to look into it now.

Offline

#6 2004-07-15 00:00:55

kakabaratruskia
Member
From: Santiago, Chile
Registered: 2003-08-24
Posts: 596

Re: zsh profile ~/.zshrc

I added this to /etc/zshenv

# load profiles from /etc/profile.d
#  (to disable a profile, just remove execute permission on it)
for profile in /etc/profile.d/*.sh; do
  if [ -x $profile ]; then
    . $profile
  fi
done
unset profile

# End of file

And where were all the sportsmen who always pulled you though?
They're all resting down in Cornwall
writing up their memoirs for a paper-back edition
of the Boy Scout Manual.

Offline

#7 2004-07-15 01:22:09

scottro
Member
From: NYC
Registered: 2002-10-11
Posts: 466
Website

Re: zsh profile ~/.zshrc

Ah, that works too.  Thanks

However, when I did that (more or less copying /etc/profile to /etc/zshenv I do get, as I log in, a message that there are no profiles in profile.d.  Commenting out that last part in /et/zshenv, however, seems to make it work as it should

Thanks again

Offline

Board footer

Powered by FluxBB