Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include typeset -U path in dotfiles #140

Open
SebiBasti opened this issue Apr 9, 2023 · 4 comments
Open

Include typeset -U path in dotfiles #140

SebiBasti opened this issue Apr 9, 2023 · 4 comments

Comments

@SebiBasti
Copy link

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.

https://zsh.sourceforge.io/Guide/zshguide02.html#l24

@ssaunier
Copy link
Member

Where would it make sense to add this?

@SebiBasti
Copy link
Author

SebiBasti commented May 22, 2023

I currently have it in the bottom half of my .zshrc and had no issues.

@SebiBasti
Copy link
Author

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
Copy link
Author

I created a PR 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants