Skip to content

Environment Variables (PATH) are aggressively cached to disk and persist across app restarts #4367

@WD142

Description

@WD142

Flow Launcher seems to cache the OS Environment Variables (like PATH) to a physical disk cache. If a user updates the Windows System PATH, Flow Launcher completely ignores the OS updates and forces child processes (like CMD) to inherit a stale environment block.

Example:

  1. Add a new CLI tool directory to the Windows System PATH.
  2. Completely quit and restart Flow Launcher.
  3. Launch CMD via Flow Launcher -> The new PATH is missing.
  4. Go to Flow settings -> About -> Click "Clear Cache".
  5. Launch CMD via Flow again -> The new PATH is STILL missing (Live memory isn't refreshed).
  6. Quit Flow Launcher completely AFTER clearing the cache, reopen it, and launch CMD -> Only now does the new PATH appear.

Caching OS environment variables to a local file to speed up boot times is inherently flawed. Furthermore, the "Clear Cache" function deletes the file but fails to flush and refresh the live environment block for the current session.

Suggestion:

  1. Do not cache Environment.GetEnvironmentVariables() to disk. It must be queried dynamically at startup.
  2. The app must listen to the WM_SETTINGCHANGE broadcast to refresh its environment block automatically during runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions