Skip to content

Commit d92f6cb

Browse files
authored
[CLI] Added TERM as leaking env vars in pure shell (#1230)
## Summary Added `$TERM` to the list of env vars that leak to pure shell. Reason being, Pure shell doesn't allow colorful text in prompt because TERM variable is unset. Adding the TERM allows pure shell to know if terminal supports color and enable it. Addresses #1200 ## How was it tested? - compile - `./devbox shell --pure` - `ls -a` - `ls -a --color` - confirm directories and executables show in different colors when `--color` is passed.
1 parent 3d3e5b8 commit d92f6cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/impl/devbox.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,8 @@ func (d *Devbox) parseEnvAndExcludeSpecialCases(currentEnv []string) (map[string
11031103
// handling special cases to for pure shell
11041104
// Passing HOME for pure shell to leak through otherwise devbox binary won't work
11051105
// We also include PATH to find the nix installation. It is cleaned for pure mode below
1106-
if !d.pure || key == "HOME" || key == "PATH" {
1106+
// TERM leaking through is to enable colored text in the pure shell
1107+
if !d.pure || key == "HOME" || key == "PATH" || key == "TERM" {
11071108
env[key] = val
11081109
}
11091110
}

0 commit comments

Comments
 (0)