Skip to content

Commit 60017c3

Browse files
authored
Merge pull request microsoft#201036 from jaraco/feature/xonsh-env
Add support for extracting environment from xonsh.
2 parents 74df98f + c62c575 commit 60017c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ 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: native implementation is shorter
141+
command = `import os, json; print("${mark}", json.dumps(dict(os.environ)), "${mark}")`;
142+
shellArgs = ['-i', '-l', '-c'];
140143
} else {
141144
command = `'${process.execPath}' ${extraArgs} -p '"${mark}" + JSON.stringify(process.env) + "${mark}"'`;
142145

0 commit comments

Comments
 (0)