Skip to content

Reload environment variables only on WM_SETTINGCHANGE #15102

Open
@lhecker

Description

@lhecker

til::env is rather complex, reads a lot of registry keys and requires lots of string operations. Since #14999 we recreate the til::env cache every time we create a new tab, but this isn't necessary, considering that changes to environment variables are exceedingly rare. Most users will run a Windows Terminal instance without it ever seeing a single environment variable change.

👉 Listen to WM_SETTINGCHANGE and only then recreate the globally shared cache. If multi-threading is a concern, just encode the variables back into a \0 separated string, the same way we get it from the OS anyways already. This would reflect how ConEmu does it: Maximus5/ConEmu#468

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-PerformancePerformance-related issueArea-QualityStability, Performance, Etc.Issue-TaskIt's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions