nickjj / dotfiles

Settings for various tools I use.
https://nickjanetakis.com/blog/the-tools-i-use
MIT License
948 stars 183 forks source link

Move .zprofile to .zshenv for normal linux installs? #23

Closed yojimbosteel closed 6 months ago

yojimbosteel commented 6 months ago

Hey Nick,

I think you can move the environment variables stored in '\~/.config/zsh/.zprofile' into '~/.zshenv' without causing any side effects.

I was running into an issue where settings were not loading and pinned it down to how the profile works; the '.zshprofile' only loads when logging in through the shell (i.e. not the normal GUI) or through SSH. Once I moved everything into the .zshenv file, it works beautifully.

I don't use WSL or know much about it but maybe it behaves differently than a normal linux install; this could explain why it doesn't cause you any issues.

Thanks for all you do, I enjoy your content.

nickjj commented 6 months ago

Hi,

These dotfiles do create ~/.zshenv which ends up being a symlink to wherever you cloned the repo. It sets your XDG config path as well as ZDOTDIR so all of the config files get picked up in ~/.config/zsh.

I don't know which terminal you're using but did you configure its login shell to use zsh?

I've used these dotfiles successfully on native Linux (and macOS) without any issues with the current configuration.

yojimbosteel commented 6 months ago

Ah, I see. The gnome-terminal has an option to launch it as a login shell, which is disabled by default. It works with the option selected. This also explains why tmux works, because it launches as a login shell by default. Thanks :)

nickjj commented 6 months ago

I'll add a FAQ item for this since not all terminals set that by default.