MCPcopy Index your code
hub / github.com/anomalyco/opencode / preferAppEnv

Function preferAppEnv

packages/desktop/src/main/server.ts:44–53  ·  view source on GitHub ↗
(userDataPath: string)

Source from the content-addressed store, hash-verified

42}
43
44export function preferAppEnv(userDataPath: string) {
45 const shell = process.platform === "win32" ? null : getUserShell()
46 Object.assign(process.env, {
47 ...(shell ? loadShellEnv(shell, getLogger()) : null),
48 OPENCODE_EXPERIMENTAL_ICON_DISCOVERY: "true",
49 OPENCODE_EXPERIMENTAL_FILEWATCHER: "true",
50 OPENCODE_CLIENT: "desktop",
51 XDG_STATE_HOME: process.env.XDG_STATE_HOME ?? userDataPath,
52 })
53}
54
55export async function spawnLocalServer(
56 hostname: string,

Callers 1

index.tsFile · 0.90

Calls 3

getUserShellFunction · 0.90
loadShellEnvFunction · 0.90
getLoggerFunction · 0.90

Tested by

no test coverage detected