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

Fallback to TMPDIR if XDG_RUNTIME_DIR is not set #842

Merged
merged 1 commit into from
Jan 18, 2025
Merged

Conversation

triarius
Copy link
Contributor

On most macOS setups, XDG_RUNTIME_DIR won't exist, but rather than creating something in the home directory, we can fall back to TMPDIR. Then, users won't have to find ways to set XDG_RUNTIME_DIR manually if they want to keep their home directory clean. Setting it manually can have some undesirable consequences, as outlined in the issue.

This approach is intended to keep the existing behaviour for users who have XDG_RUNTIME_DIR set. If they don't, and have TMPDIR set, then their runtimeDir will change. Otherwise, it will do nothing for them.

There may be users with neither XDG_RUNTIME_DIR nor TMPDIR set. I think we will be happy for them to make another PR if they don't want the runtimeDir in their home directory.

Fixes: #833

Copy link
Owner

@fsouza fsouza 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 contributing!

@fsouza fsouza merged commit 3be62aa into fsouza:main Jan 18, 2025
9 checks passed
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.

Use TMPDIR on macOS for creating runtime files
2 participants