Include `typeset -U path` in dotfiles
SebiBasti opened this issue · 4 comments
SebiBasti commented
Over time the $PATH
variable can get quite bloated and have many duplicates inside.
typeset -U path
This takes care of this and checks path
to only include unique values e.g. it deletes all duplicates.
ssaunier commented
Where would it make sense to add this?
SebiBasti commented
I currently have it in the bottom half of my .zshrc
and had no issues.
SebiBasti commented
I checked again with the help of chatGPT:
Putting it all together, the code typeset -U path is instructing the shell to modify the path variable and
ensure that it contains only unique elements. It is useful in scenarios where you want to avoid
having duplicate directory paths in the PATH variable.
I think there's no risk in including it in .zshrc
.
SebiBasti commented
I created a PR 👌