-
Notifications
You must be signed in to change notification settings - Fork 34.8k
Description
EnvironmentVariableCollection currently support modifying a variable, or deleting a modification in that collection, but not unsetting an environment variable.
Sometimes we want to unset variables in the direnv extension but there is no API for it (and if we force null
or undefined
through the current API they get automatically stringified to "null"
and "undefined"
).
The closest we can do is set them to the empty string (what POSIX calls null), but then some programs insist on distinguishing empty from undefined variables.
(N.B. Shells make this intentionally hard, for example the bash man page omits the expansion modifiers that distinguish null and unset variables.)
This could be done either by allowing null
and/or undefined
as the replacement value for replace
, or with a new method on the API.
Related issue: direnv/direnv-vscode#527, and previously NixOS/nix#6409
Related commits: direnv/direnv-vscode@9905fe7, and previously direnv/direnv-vscode@79a4841