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

respect ZSH's $ZDOTDIR environment variable #942

Merged
merged 2 commits into from
Dec 9, 2023
Merged

Conversation

dennis-tra
Copy link
Contributor

@dennis-tra dennis-tra commented May 6, 2023

ZSH reads its configuration by default relative to a path set via $ZDOTDIR. If $ZDOTDIR is not set, then the value of $HOME is used; this is the usual case. Source: https://zsh.sourceforge.io/Intro/intro_3.html#IDX11

Also, $HOME is safe to use because "The system shall initialize this variable at the time of login to be a pathname of the user's home directory". Source: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html

Lastly, the shell parameter expansion syntax is safe to use either: https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02

I double-quoted the whole string in case there were spaces in the path.


You might want to double-check if similar considerations apply to bash.

ZSH reads its configuration by default relative to a path that's set via $ZDOTDIR. If $ZDOTDIR is not set, then the value of $HOME is used; this is the usual case. Source:  https://zsh.sourceforge.io/Intro/intro_3.html#IDX11

Also $HOME is save to use, because "The system shall initialize this variable at the time of login to be a pathname of the user's home directory". Source: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html

Lastly, the shell parameter expansion syntax is save to use generically: https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02
@vercel
Copy link

vercel bot commented May 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
atuin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2023 5:50pm
atuin-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2023 5:50pm

ellie
ellie previously approved these changes Dec 9, 2023
Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Sorry it took me to long to review

Seeing as this is your first time contributing, if you would like a holographic contributors-only Atuin sticker, then please fill out this form!

We do also have a Discord if you'd like to ask any questions, or just fancy hanging out!

@ellie ellie merged commit bdd7fe6 into atuinsh:main Dec 9, 2023
10 checks passed
@dennis-tra
Copy link
Contributor Author

Thanks for merging! I just checked the change set again and saw that the line above should also have the same change. Will follow up with a second 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

Successfully merging this pull request may close these issues.

2 participants