Allow for default value in `${localEnv:...}` and `${containerEnv:...}`

Goal

String values in the devcontainer.json can contain ${localEnv:ENV_VAR} and ${containerEnv:ENV_VAR} placeholders which are replaced with the (either the local or the container) ENV_VAR environment variable's value at runtime. The goal is to allow for a default value to be specified as part of the syntax that will be used when the ENV_VAR is not set.

Proposal

The proposal is to add an optional default value separated by a second colon in the existing notation: ${localEnv:ENV_VAR:default_value} and ${containerEnv:ENV_VAR:default_value} and to replace the notation with the default value when there is no ENV_VAR environment variable at runtime. The existing behavior without a default value remains unchanged.

Notes

We have a PR from the community implementing this proposal: devcontainers/cli#51