Skip to content

[Request]: Use environment variables as system property source instead of UserDefaults. #608

@jglogan

Description

@jglogan

Feature or enhancement request details

While UserDefaults are idiomatic for macOS, they apply globally to all sessions, and in some cases session-level control of a property may be desirable.

Environment variables are idiomatic for Unix/Linux developer tools and can apply globally (rc/profile files) and per session.

For this reason we should consider replacing UserDefaults with environment variables. While we could include both as property sources, it results in needless complexity and could create confusing scenarios.

We'd need to look at the variables we have and see which could be problematic if changed per session. Some variables are used only in helpers so the values they use would be established when the helper starts and immutable afterward (whereas a UserDefault could be updated while a helper runs).

It'd be great to get some opinions on this before proceeding. I was thinking that ideally we'd have a system for defining system properties, where each property is enumerable, generic, validated, type-safe, and defines a chain of command for its backing store.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needednextItems in scope for the next few milestonesuxUser experience features and fixes.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions