FS#45937 - [zsh]/etc/zprofile sources /etc/profile (again)
Attached to Project:
Arch Linux
Opened by Bryan Bennett (bbenne10) - Sunday, 09 August 2015, 21:20 GMT
Last edited by Doug Newgard (Scimmia) - Wednesday, 12 August 2015, 22:32 GMT
Opened by Bryan Bennett (bbenne10) - Sunday, 09 August 2015, 21:20 GMT
Last edited by Doug Newgard (Scimmia) - Wednesday, 12 August 2015, 22:32 GMT
|
Details
This is an issue that's been discussed before (see #24953,
#2653, & #35966), but never adequately resolved. Our zsh
package ships /etc/zsh/zprofile. This file contains nothing
but a source of /etc/profile. Zsh's docs explicitly ask the
user to set env vars in a zshenv that's sourced before all
other files. Because we source /etc/profile, which exports
PATH, we effectively make a VERY fundamental usage paradigm
of Zsh useless in a VERY common case.
This has been closed before as fixed or not a bug, though in slightly different circumstances. We at one point had /etc/zprofile as a symlink to /etc/profile, which was changed to the current solution of removing /etc/zprofile in favor of using /etc/zsh/zprofile and having /etc/zsh/zprofile source /etc/profile. This move has caused our current dilemma. I propose that we introduce a conditional into /etc/profile that simply checks either for $SHELL containing *zsh* (to account for local installs) or checks whether the current value for $PATH is equal to the default value (/usr/bin/) before overriding the exported PATH. I'm currently doing the latter and it seems to work well enough. Another solution would be to enforce a variable being set in a user's zshenv to avoid the PATH setting happening at /etc/profile as a means of allowing an opt-in to the new behavior while not changing the old. For instance, ~user/.zshenv could "export _PROFILE_NO_SET_PATH=1" which could be checked in /etc/profile before munging the path. |
This task depends upon
Closed by Doug Newgard (Scimmia)
Wednesday, 12 August 2015, 22:32 GMT
Reason for closing: Duplicate
Additional comments about closing: FS#35966
Wednesday, 12 August 2015, 22:32 GMT
Reason for closing: Duplicate
Additional comments about closing:
FS#35966