MCPcopy
hub / github.com/wavetermdev/waveterm / PruneInitialEnv

Function PruneInitialEnv

pkg/util/envutil/envutil.go:115–129  ·  view source on GitHub ↗
(envMap map[string]string)

Source from the content-addressed store, hash-verified

113}
114
115func PruneInitialEnv(envMap map[string]string) map[string]string {
116 pruned := make(map[string]string)
117 for key, value := range envMap {
118 if strings.HasPrefix(key, "WAVETERM_") || strings.HasPrefix(key, "BASH_FUNC_") {
119 continue
120 }
121 if key == "XDG_SESSION_ID" || key == "SHLVL" || key == "S_COLORS" ||
122 key == "SSH_CONNECTION" || key == "SSH_CLIENT" || key == "LESSOPEN" ||
123 key == "which_declare" {
124 continue
125 }
126 pruned[key] = value
127 }
128 return pruned
129}

Callers 2

serverRunFunction · 0.92
createMainWshClientFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected