Skip to content

Commit f729d50

Browse files
authored
[shellenv] filter out DEVBOX_LATEST_VERSION env var (#1331)
## Summary The Devbox launcher invokes the Devbox binary with `DEVBOX_LATEST_VERSION` env-var being set. The Devbox binary uses this env-var to determine if a new version is available, and if it needs to alert the user to update. This env-var was never intended to be "exported" to the rest of the environment. However, `devbox shellenv` was doing so. This becomes problematic if a user does `eval $(devbox global shellenv)` in their shellrc file, and has done `devbox global add coreutils`. Then, doing `ls` or `cat <file>`, or using any of the coreutils programs seems to trigger an avalanche of "new Devbox available" notices. Fix: this PR filters out `DEVBOX_LATEST_VERSION` from the environment that shellenv exports. ## How was it tested? ``` > export DEVBOX_LATEST_VERSION=0.5.12 # verify it was being exported > devbox shellenv | grep "DEVBOX_LATEST" DEVBOX_LATEST_VERSION=0.5.12 > devbox run build # no longer present > devbox shellenv | grep "DEVBOX_LATEST" ```
1 parent 31d2c00 commit f729d50

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/impl/devbox.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,8 @@ func (d *Devbox) configEnvs(computedEnv map[string]string) map[string]string {
10081008
// from the slice of [os.Environ] variables before sourcing them. These are
10091009
// variables that are set automatically by a new shell.
10101010
var ignoreCurrentEnvVar = map[string]bool{
1011+
envir.DevboxLatestVersion: true,
1012+
10111013
// Devbox may change the working directory of the shell, so using the
10121014
// original PWD and OLDPWD would be wrong.
10131015
"PWD": true,

0 commit comments

Comments
 (0)