mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 13:57:26 -08:00
fix(shell): split environment variable name and value correctly
This commit is contained in:
parent
9ec794cacf
commit
1a1aecbd36
|
@ -724,13 +724,11 @@ func (env *Shell) TemplateCache() *TemplateCache {
|
|||
const separator = "="
|
||||
values := os.Environ()
|
||||
for value := range values {
|
||||
splitted := strings.Split(values[value], separator)
|
||||
if len(splitted) != 2 {
|
||||
key, val, valid := strings.Cut(values[value], separator)
|
||||
if !valid {
|
||||
continue
|
||||
}
|
||||
key := splitted[0]
|
||||
val := splitted[1:]
|
||||
tmplCache.Env[key] = strings.Join(val, separator)
|
||||
tmplCache.Env[key] = val
|
||||
}
|
||||
pwd := env.Pwd()
|
||||
tmplCache.PWD = ReplaceHomeDirPrefixWithTilde(env, pwd)
|
||||
|
|
Loading…
Reference in a new issue