Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATH reordered when running zsh inside screen on Mac OS X Mountain Lion and MacPorts
- X-seq: zsh-users 17616
- From: Lawrence Velázquez <larryv@xxxxxxxxxxxx>
- To: Nikolai Weibull <now@xxxxxxxx>
- Subject: Re: PATH reordered when running zsh inside screen on Mac OS X Mountain Lion and MacPorts
- Date: Tue, 29 Jan 2013 01:21:09 -0500
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CADdV=MsUJMzcskj8c7iYokX-JO5i_r33UQLNoSB4yKephTWeXw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CADdV=Mu+3ky43q0z20oc1Za9ZfPRFw52kxkB7PWxqO+FcLqeXQ@mail.gmail.com> <CACQNQ9OpCrRQT754wbs5LLBndFJsyebG-h1XB52WPaC-u537+Q@mail.gmail.com> <CADdV=MsUJMzcskj8c7iYokX-JO5i_r33UQLNoSB4yKephTWeXw@mail.gmail.com>
On Jan 28, 2013, at 5:08 AM, Nikolai Weibull <now@xxxxxxxx> wrote:
> I figured out what the problem was. /etc/zshenv on Mac OS X Mountain Lion calls a utility called path_helper.
The /usr/libexec/path_helper program is used by prior versions of OS X also, albeit implemented differently. (At one point it was a shell script.) Its purpose is to create a default ${PATH} and ${MANPATH} using the contents of /etc/{paths,manpaths} and /etc/{paths,manpaths}.d.
For more details, see the path_helper(8) man page[1]. For way too many details, see the path_helper source code[2].
[1] https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/path_helper.8.html.
[2] http://www.opensource.apple.com/source/shell_cmds/shell_cmds-170/path_helper/path_helper.c
> Oh, and why /etc/zshenv in Mac OS X Mountain Lion modifies path in this way is way beyond me. In my world, that’d go into /etc/zprofile.
I agree that /etc/zprofile would be a better place to set ${PATH}, but you would still run into the issue because terminal multiplexers usually run login shells. I previously encountered it under tmux.
The real problem is that /usr/libexec/path_helper alters ${PATH} even if ${PATH} already contains the entries it wants to add. In this case, it moves the entries to the beginning of ${PATH} instead of just leaving it as is.
> as far as I can tell, this didn’t occur before I upgraded to 5.0.2 (from zsh-devel? (which was at 5.0.0?), can’t remember).
The old zsh-devel port did use --enable-etcdir in its configure phase. For the reason given by Phil, I chose not to carry this over to the zsh port when I assumed maintenance of both and obsoleted zsh-devel.
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author