MCPcopy Index your code
hub / github.com/coder/coder / addCriticalEnv

Function addCriticalEnv

pty/start_windows.go:190–203  ·  view source on GitHub ↗

addCriticalEnv adds any critical environment variables that are required (or at least almost always required) on the operating system. Currently this is only used for Windows.

(env []string)

Source from the content-addressed store, hash-verified

188// (or at least almost always required) on the operating system.
189// Currently this is only used for Windows.
190func addCriticalEnv(env []string) []string {
191 for _, kv := range env {
192 eq := strings.Index(kv, "=")
193 if eq < 0 {
194 continue
195 }
196 k := kv[:eq]
197 if strings.EqualFold(k, "SYSTEMROOT") {
198 // We already have it.
199 return env
200 }
201 }
202 return append(env, "SYSTEMROOT="+os.Getenv("SYSTEMROOT"))
203}

Callers 1

startPtyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected