zsh-users
 help / color / mirror / code / Atom feed
From: Eric Cook <llua@gmx.com>
To: zsh-users@zsh.org
Subject: Re: zprofile and .profile sourcing
Date: Thu, 8 Sep 2022 17:42:58 -0400	[thread overview]
Message-ID: <5556798a-b9a5-6f58-2c41-7563e771516b@gmx.com> (raw)
In-Reply-To: <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.


  reply	other threads:[~2022-09-08 21:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 21:37 Piscium
2022-09-08 21:42 ` Eric Cook [this message]
2022-09-08 21:45   ` Eric Cook
2022-09-08 22:12     ` Piscium
2022-09-08 22:30       ` Lawrence Velázquez
2022-09-08 22:45         ` Piscium
2022-09-13  7:28           ` Piscium
2022-09-08 23:14 ` Felipe Contreras

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=5556798a-b9a5-6f58-2c41-7563e771516b@gmx.com \
    --to=llua@gmx.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).