zsh-users
 help / color / mirror / code / Atom feed
* Invocation of zshenv
@ 2013-01-15 11:14 Florian Lindner
  2013-01-15 13:02 ` Peter Stephenson
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Florian Lindner @ 2013-01-15 11:14 UTC (permalink / raw)
  To: zsh-users

Hello,

I have some PATH, EDITOR and PYTHONPATH set in my .zshenv. As far as I 
understand it zshenv should be invoced on every kind of shell but when I login 
using SSH it is not being sourced.

What is the file to put such things that should be available in _every_ shell 
session?

Thanks!


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Invocation of zshenv
  2013-01-15 11:14 Invocation of zshenv Florian Lindner
@ 2013-01-15 13:02 ` Peter Stephenson
  2013-01-17  9:23   ` Florian Lindner
  2013-01-15 13:15 ` Russell Harmon
  2013-01-15 15:22 ` Ivan Sichmann Freitas
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 2013-01-15 13:02 UTC (permalink / raw)
  To: zsh-users

On Tue, 15 Jan 2013 12:14:45 +0100
Florian Lindner <mailinglists@xgm.de> wrote:
> I have some PATH, EDITOR and PYTHONPATH set in my .zshenv. As far as
> I understand it zshenv should be invoced on every kind of shell but
> when I login using SSH it is not being sourced.
> 
> What is the file to put such things that should be available in
> _every_ shell session?

.zshenv is the file to use.  If it's not being sourced on some
occasions, something somewhere is changing the configuration.  The only
ways of doing this I can think of are for something in /etc/zshenv to
stop it by setting the option NO_RCS, or for the environment variable
ZDOTDIR to point to a different directory, or for some emulation mode
such as ksh that doesn't use it to be in effect.

pws


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Invocation of zshenv
  2013-01-15 11:14 Invocation of zshenv Florian Lindner
  2013-01-15 13:02 ` Peter Stephenson
@ 2013-01-15 13:15 ` Russell Harmon
  2013-01-15 15:22 ` Ivan Sichmann Freitas
  2 siblings, 0 replies; 7+ messages in thread
From: Russell Harmon @ 2013-01-15 13:15 UTC (permalink / raw)
  To: Florian Lindner; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

You can invoke zsh with the -x argument to see the initialization scripts
running and check what's happening.
--
Russell Harmon


On Tue, Jan 15, 2013 at 6:14 AM, Florian Lindner <mailinglists@xgm.de>wrote:

> Hello,
>
> I have some PATH, EDITOR and PYTHONPATH set in my .zshenv. As far as I
> understand it zshenv should be invoced on every kind of shell but when I
> login
> using SSH it is not being sourced.
>
> What is the file to put such things that should be available in _every_
> shell
> session?
>
> Thanks!
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Invocation of zshenv
  2013-01-15 11:14 Invocation of zshenv Florian Lindner
  2013-01-15 13:02 ` Peter Stephenson
  2013-01-15 13:15 ` Russell Harmon
@ 2013-01-15 15:22 ` Ivan Sichmann Freitas
  2 siblings, 0 replies; 7+ messages in thread
From: Ivan Sichmann Freitas @ 2013-01-15 15:22 UTC (permalink / raw)
  To: zsh-users

On Tue, Jan 15, 2013 at 12:14:45PM +0100, Florian Lindner did gyre and gimble:

>I have some PATH, EDITOR and PYTHONPATH set in my .zshenv. As far as I
>understand it zshenv should be invoced on every kind of shell but when I login
>using SSH it is not being sourced.

Also, .zshenv is sourced befora /etc/profile, so make sure your system's
doesn't clobber anything important (once had a problem in archlinux when
/etc/profile didn't export the already existing path into the new one).

-- 
Ivan Sichmann Freitas
GNU/Linux user #509059
SDF Arpa Member http://isf.sdf.org/about.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Invocation of zshenv
  2013-01-15 13:02 ` Peter Stephenson
@ 2013-01-17  9:23   ` Florian Lindner
  2013-01-17 14:58     ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Florian Lindner @ 2013-01-17  9:23 UTC (permalink / raw)
  To: zsh-users

Am Dienstag, 15. Januar 2013, 13:02:47 schrieb Peter Stephenson:
> On Tue, 15 Jan 2013 12:14:45 +0100
> 
> Florian Lindner <mailinglists@xgm.de> wrote:
> > I have some PATH, EDITOR and PYTHONPATH set in my .zshenv. As far as
> > I understand it zshenv should be invoced on every kind of shell but
> > when I login using SSH it is not being sourced.
> > 
> > What is the file to put such things that should be available in
> > _every_ shell session?
> 
> .zshenv is the file to use.  If it's not being sourced on some
> occasions, something somewhere is changing the configuration.  The only
> ways of doing this I can think of are for something in /etc/zshenv to
> stop it by setting the option NO_RCS, or for the environment variable
> ZDOTDIR to point to a different directory, or for some emulation mode
> such as ksh that doesn't use it to be in effect.

ZDOTDIR and NO_RCS are not set, neither as environment variable nor it's 
mentioned in the config.

But actually, I forgot to mention I'm using the grml-zsh-config on Arch.

.zshenv is sourced on normal login shells.

Ivan mentioned a problem regarding /etc/profile. My profile contains:

# Set our default path
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
export PATH

So it sets and exports the PATH but does not take a already set PATH variable 
into account. If .zshenv is sourced before /etc/profile that would explain it. 
But why only on SSH shells not on usual shells?

Thanks,

Florian


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Invocation of zshenv
  2013-01-17  9:23   ` Florian Lindner
@ 2013-01-17 14:58     ` Bart Schaefer
  2013-01-20 18:43       ` Florian Lindner
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2013-01-17 14:58 UTC (permalink / raw)
  To: zsh-users

On Jan 17, 10:23am, Florian Lindner wrote:
}
} So [/etc/profile] sets and exports the PATH but does not take a
} already set PATH variable into account. If .zshenv is sourced before
} /etc/profile that would explain it. But why only on SSH shells not on
} usual shells?

How do you typically create a "usual shell"?  Log in on console, or
open a terminal window on a graphical desktop?

If the latter, it's possible that ssh shells are being invoked as
login shells whereas "usual" shells are not.  This will depend on the
configuration of the terminal emulator.

Try putting

    setopt NO_GLOBAL_RCS

in your .zshenv to see if that suppresses /etc/profile.  However, you
may not want that in general, depending on what other environment the
global init files are establishing for you.  Instead you may simply
need to reset the path again in a later file.

I put my path-setting logic in an extra file which is "source"d from
both .zshenv and .zlogin (first and last files sourced at startup).
This also has the advantage of making it easier to customize the path
to each local host.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Invocation of zshenv
  2013-01-17 14:58     ` Bart Schaefer
@ 2013-01-20 18:43       ` Florian Lindner
  0 siblings, 0 replies; 7+ messages in thread
From: Florian Lindner @ 2013-01-20 18:43 UTC (permalink / raw)
  To: zsh-users; +Cc: Bart Schaefer

Am Donnerstag, 17. Januar 2013, 06:58:47 schrieb Bart Schaefer:
> On Jan 17, 10:23am, Florian Lindner wrote:
> }
> } So [/etc/profile] sets and exports the PATH but does not take a
> } already set PATH variable into account. If .zshenv is sourced before
> } /etc/profile that would explain it. But why only on SSH shells not on
> } usual shells?
> 
> How do you typically create a "usual shell"?  Log in on console, or
> open a terminal window on a graphical desktop?

Ok, I just found out that it works only when using the shell from my graphical 
environment (KDE).

Login from a text console or SSH does not work. But .zshenv is invoked in any 
case. I suspect that the two latter cases (text + SSH) are login shells and 
/etc/profile is evaluated. This file simply sets and not append/prepend to a 
existing PATH.

> If the latter, it's possible that ssh shells are being invoked as
> login shells whereas "usual" shells are not.  This will depend on the
> configuration of the terminal emulator.

I concur.

> 
> Try putting
> 
>     setopt NO_GLOBAL_RCS
> 
> in your .zshenv to see if that suppresses /etc/profile.  However, you
> may not want that in general, depending on what other environment the
> global init files are establishing for you.  Instead you may simply
> need to reset the path again in a later file.

It works (the PATH setting I did in .zshenv is there). But as you have guessed 
it fucks up my environment ;-)
 
> I put my path-setting logic in an extra file which is "source"d from
> both .zshenv and .zlogin (first and last files sourced at startup).
> This also has the advantage of making it easier to customize the path
> to each local host.

I changed my /etc/profile from

PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"

to

PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"

Any potential problems with that?

Thanks!

Florian


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-01-20 19:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-15 11:14 Invocation of zshenv Florian Lindner
2013-01-15 13:02 ` Peter Stephenson
2013-01-17  9:23   ` Florian Lindner
2013-01-17 14:58     ` Bart Schaefer
2013-01-20 18:43       ` Florian Lindner
2013-01-15 13:15 ` Russell Harmon
2013-01-15 15:22 ` Ivan Sichmann Freitas

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).