home-manager icon indicating copy to clipboard operation
home-manager copied to clipboard

make zsh session vars safer

Open postsolar opened this issue 11 months ago • 3 comments

Description

If the shell is launched with -u flag, references to unset variables result in errors. Since in this case the variable is expected to be unset, there is no reason for this code to result in error. This commit prevents this potential error by providing a fallback value (the empty string) for the variable.

Checklist

  • [ ] Change is backwards compatible.

  • [ ] Code formatted with ./format.

  • [ ] Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • [ ] Test cases updated/added. See example.

  • [ ] Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • [ ] Added myself as module maintainer. See example.

Maintainer CC

postsolar avatar Mar 12 '24 20:03 postsolar