zsh-users
 help / color / mirror / code / Atom feed
From: Florian Lindner <mailinglists@xgm.de>
To: zsh-users@zsh.org
Cc: Bart Schaefer <schaefer@brasslantern.com>
Subject: Re: Invocation of zshenv
Date: Sun, 20 Jan 2013 19:43:27 +0100	[thread overview]
Message-ID: <3828409.yvgubn8Pyh@horus> (raw)
In-Reply-To: <130117065847.ZM23286@torch.brasslantern.com>

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


  reply	other threads:[~2013-01-20 19:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 11:14 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 [this message]
2013-01-15 13:15 ` Russell Harmon
2013-01-15 15:22 ` Ivan Sichmann Freitas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3828409.yvgubn8Pyh@horus \
    --to=mailinglists@xgm.de \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).