Skip to content

Commit c62c575

Browse files
committed
Provide a native implementation, bypassing issues invoking electron.
1 parent 6da0f6d commit c62c575

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/platform/shell/node/shellEnv.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ async function doResolveUnixShellEnv(logService: ILogService, token: Cancellatio
137137
} else if (name === 'nu') { // nushell requires ^ before quoted path to treat it as a command
138138
command = `^'${process.execPath}' ${extraArgs} -p '"${mark}" + JSON.stringify(process.env) + "${mark}"'`;
139139
shellArgs = ['-i', '-l', '-c'];
140-
} else if (name === 'xonsh') { // #200374: xonsh expects escaping to avoid Python syntax
141-
command = `$['${process.execPath}' ${extraArgs} -p '"${mark}" + JSON.stringify(process.env) + "${mark}"']`;
140+
} else if (name === 'xonsh') { // #200374: native implementation is shorter
141+
command = `import os, json; print("${mark}", json.dumps(dict(os.environ)), "${mark}")`;
142142
shellArgs = ['-i', '-l', '-c'];
143143
} else {
144144
command = `'${process.execPath}' ${extraArgs} -p '"${mark}" + JSON.stringify(process.env) + "${mark}"'`;

0 commit comments

Comments
 (0)