On Tue, Apr 1, 2008 at 10:27 AM, Jonatan Liljedahl <[EMAIL PROTECTED]> wrote:
> Nick Matteo wrote:
> > On Mon, Mar 31, 2008 at 8:41 AM, Jonatan Liljedahl <[EMAIL PROTECTED]>
> wrote:
> >> I'm trying out the SLIM display manager, and there's a problem with the
> >> initialization of the shell.
> >>
> >> I have set this in slim.conf:
> >>
> >> login_cmd exec /bin/zsh --login ~/.xinitrc %session
> >>
> >> Now, this runs .zprofile but not .zshrc, so I have put all my custom
> >> environment variables in ~/.zprofile. But there's lots of things in
> >> /etc/zshrc that should go in /etc/zprofile! For example reading the
> >> Environment files from packages. This means that my desktop runs without
> >> these environment variables set, and gives lots of troubles...
> > <snip>
> >
> > Can't you either a) use sh, where .bash_profile and .bashrc both
> > source /etc/bashrc which loads Environment cache, etc. (I think sh is
> > expected to be used for most non-interactive things; zsh is for
> > interactive shenanigans)
> > b) use +f on the zsh command line to force sourcing /etc/zshrc
> > c) add
> > [[ `basename $SHELL` == zsh ]] && source /etc/zshrc
> > to the .xinitrc
>
> I don't like having lots of different startup files, is there duplicated
> code in /etc/bashrc and /etc/zshrc? couldn't some things be centralized
> and sourced by both if needed, etc?
It has to be duplicated anyway, for if you use bash. That's not really
problematic.
> > Moving everything to /etc/zprofile won't work because the main concern
> > is to make sure it's loaded in all _interactive_ shells. (which
> > zprofile isn't, it's only login shells; zshrc on the other hand is for
> > exactly this.) You could have zshrc source zprofile, or you could
> > just let scripts run in sh (which they pretty much all do) and leave
> > the slim config running sh --login (which it does by default) and
> > everything will be fine.
>
> No, zprofile is loaded for all login shells, and zshrc is loaded for
> interactive shells *additionally*. So I really think that zshrc should
> contain only stuff related to interactive shells, like prompt and
> aliases, etc.. while important setup, variables (like PATH and programs
> Environment files) should be in zprofile.
Neither xterm nor any of its derivatives start login shells by
default, so zprofile would not be loaded in them and mayn't have been
beforehand. See the zsh guide for exactly what gets loaded when:
http://zsh.sunsite.dk/Guide/zshguide02.html#l9
-Michael
_______________________________________________
gobolinux-devel mailing list
gobolinux-devel@lists.gobolinux.org
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel