Skip empty XDG values in shellexec (#2006)

This commit is contained in:
Evan Simkowitz 2025-02-20 16:54:03 -08:00 committed by GitHub
parent 27c01cfb28
commit 7d1c80568d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -534,7 +534,7 @@ func StartLocalShellProc(logCtx context.Context, termSize waveobj.TermSize, cmdS
if len(pamEnvs) > 0 {
// We only want to set the XDG variables from the PAM environment, all others should already be correct or may have been overridden by something else out of our control
for k := range pamEnvs {
if _, ok := varsToReplace[k]; ok {
if _, ok := varsToReplace[k]; ok && len(pamEnvs[k]) > 0 {
varsToReplace[k] = pamEnvs[k]
}
}