from zsh document, ~/.zprofile should only be sourced at login shell, and should NOT be sourced at every interactive session (for example, a new tab in a terminal).
- I am running MacOS Big Sur 11.2.3 (20D91).
But I can confirm that my ~/.zprofile is sourced at every interactive session (a new tab). Why is that? Is this a bug? How to stop this incorrect behavior?
.zprofile. If you then runzshin azshshell, you will come to the conclusion that it will not source.zprofileagain, but yes, new tabs and windows are login shells, not so much in Linux though. And MacOS behaves the same when you switch your shell to/bin/bash. New terminal windows will always source.bash_profileor.profile, but unless tozshbashwill never source.bashrcin login shells, so that's why.bash_profiletypically sources.bashrcmanually. – Martin Braun Jan 24 '24 at 10:50