Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: environment settings



On Tue, Jun 17, 2008 at 12:41:26PM +0200, Vincent Lefevre wrote:
> On 2008-06-17 10:39:00 +0100, Stephane Chazelas wrote:
> > My understanding is that ~/.zshenv is for hacking in situations
> > where you can't do otherwise.
> 
> I completely disagree. ~/.zshenv is useful to define environment
> variables when the first zsh shell isn't always a login shell, in
> which case ~/.zprofile isn't read (e.g. when the user's main shell
> is not zsh and zsh is executed from that shell, or when one uses
> ssh + command; the user shouldn't be forced to use the -l flag).
> This is also better than the ~/.zprofile when the user often
> changes his config files and doesn't want to logout and login
> again (meaning quitting the X session...).
> 
> Moreover ~/.zshenv is useful to define things that are not exported,
> such as shell variables, named directories and so on, that can also
> be used in non-interactive shells.
[...]

And I still think that would be a dirty hack and asking for trouble.

Changing the behavior of every zsh instance, even the instances
that run script that you've not written is very bad practice
IMO especially when you consider that the behavior is only
affected for the processes that have your euid.

So, it has its uses, but mainly for non-normal operation, when
you can't be bothered or don't have the right to do the /right
thing/.

-- 
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author