Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zprofile and .profile sourcing
- X-seq: zsh-users 28054
- From: Eric Cook <llua@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: zprofile and .profile sourcing
- Date: Thu, 8 Sep 2022 17:42:58 -0400
- Archived-at: <https://zsh.org/users/28054>
- In-reply-to: <CAFMg86us4mMjoxT4O0EGGHnKdKwWbV=2ZON5kz6UAkBXGoVJYQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAFMg86us4mMjoxT4O0EGGHnKdKwWbV=2ZON5kz6UAkBXGoVJYQ@mail.gmail.com>
On 9/8/22 17:37, Piscium wrote:
I have been trying (unsuccessfully) to figure out why ~/.profile is
sourced in some cases and not in others.
I am on Arch Linux, and zsh is my login shell. If I log in to Arch
over lightdm to a Xfce session, then a variable defined in .profile
becomes part of my environment. I think this is because in Arch
/etc/zsh/zprofile has a single statement that calls /etc/profile in sh
compatibility mode:
https://github.com/archlinux/svntogit-packages/blob/packages/zsh/trunk/zprofile
And here is /etc/profile:
https://github.com/archlinux/svntogit-packages/blob/packages/filesystem/trunk/profile
However if within Xfce I log in to a Linux console with Ctrl-Alt-F4;
or if I log in to a headless (no X, no Wayland) Arch VM in VirtualBox;
then a variable defined in .profile does not become part of my
environment. Why?
The Zsh man page says (in different sections):
"Login shells source /etc/profile followed by $HOME/.profile."
"If the shell is a login shell, commands are read from
/etc/zsh/zprofile and then $ZDOTDIR/.zprofile."
~/ zsh --version
zsh 5.9 (x86_64-pc-linux-gnu)
What am I missing?
One of more possible things around your display manager is happening,
1) not using your login shell to start graphical environment, but does uses a shell that reads .profile
2) it is manually checking for and sourcing it before starting the graphical environment, possibly with or without your login shell
3) something else unrelated to zsh.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author