You are not logged in.
Pages: 1
Hello guys and girls,
I know, I know, there are a lot of results for this subject but I really looked them through and couldn't find a solution.
Actually, all I want is adding ~/bin/ to my $PATH. So, as described in the Arch Wiki, I added this to my .zprofile:
typeset -U path
path=(~/bin $path[@])
But it doesn't work. If I run "source .zprofile" manually, it does work though. So apprently, .zprofile isn't sourced.
What am I missing?
Last edited by GartenEden (2016-04-11 18:17:40)
Offline
Have you logged out and back in since editing .zprofile? It is only read for login shells.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Online
I restarted the machine, yes.
For login shells only? You mean, it's not parsed for my gnome-terminal? Shall I put the code in .zshrc then?
Offline
It's not parsed for interactive shells, no, but the values set in the login shell should be inherited by the interactive shells. To be honest, I've never seen environment variable manipulation done like that. You may want to try a basic
export PATH="~/bin:$PATH"
in your zprofile instead and see if that works.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Online
It's also described in zsh's guide. Anyway, I tried your suggestion, it doesn't work either.
As I said, if I source .zprofile by hand, the $PATH is updated for that terminal session, as expected.
Offline
Strange. Are you explicitly setting PATH anywhere in your .zshrc and/or .zlogin?
STARTUP/SHUTDOWN FILES
Commands are first read from /etc/zshenv; this cannot be overridden. Subsequent behaviour
is modified by the RCS and GLOBAL_RCS options; the former affects all startup files, while
the second only affects global startup files (those shown here with an path starting with
a /). If one of the options is unset at any point, any subsequent startup file(s) of the
corresponding type will not be read. It is also possible for a file in $ZDOTDIR to
re-enable GLOBAL_RCS. Both RCS and GLOBAL_RCS are set by default.
Commands are then read from $ZDOTDIR/.zshenv. If the shell is a login shell, commands are
read from /etc/zprofile and then $ZDOTDIR/.zprofile. Then, if the shell is interactive,
commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc. Finally, if the shell is a
login shell, /etc/zlogin and $ZDOTDIR/.zlogin are read.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Online
This is my .zshrc.
(Both sourced files at the end don't change the $PATH)
My .zprofile consists only of
export PATH="~/bin:$PATH"
now. I logged out and in again.
Offline
That hastebin link is broken...
Does this work?
typeset -U path
path=($HOME/bin $path)
Offline
Oh, they deleted it... Here is my .zshrc again.
@jasonwryan: As I said, the code seems once it is sourced—if I source it manually, it works—so I guess the problem is not the code the self but that .zprofile isn't sourced when I run my gnome-terminal. (I tried your snippet anyway, doesn't work.)
Offline
How do you login? You aren't using GDM are you?
Offline
How do you login? You aren't using GDM are you?
Yes, I do.
Offline
Display Managers "helpfully" ignore some of the shell initialisation files. That is why your .zprofile isn't being read...
Offline
@jasonwryan Thanks for the link.
So I decided to put the PATH part to .zshrc. I hope it's not too bad.
Anyway, it seems to work. Thank you for your help.
Offline
Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.
Offline
Pages: 1