microsoft / microsoft/vscode

[Bug] CoPilot Chat is unable to invoke commands when `pwsh` is the default shell, because its mandatory wrapper prepends POSIX `$Env:PATH` assignments to every invoked command.

Open
#334,735 0 comments 0 reactions 1 assignee Claimed by @anthonykim1 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

#### Whether This Issue Recurs When All Extensions Are Disabled

I have yet to ascertain this.

#### VS Code Version

-

~~~YAML
Version: 1.137.0-insider
Commit: de8cc55dae905582f191fdcfb6dff8c811a743c4
Date: 2026-09-04T15:53:39Z
Electron: 42.10.0
ElectronBuildId: 15109253
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
@github/copilot: 1.0.83-2
@github/copilot-sdk: 1.0.13-preview.4
OS: Linux x64 7.1.13-200.fc44.x86_64
~~~

- 1.

~~~python
#!/usr/bin/env python3
import rpm, yaml
from datetime import datetime, timezone
from shutil import which
package = which("code-insiders")
header = next(
rpm.TransactionSet().dbMatch(
"basenames",
package
)
)
tags = (
"NAME",
"VERSION",
"RELEASE",
"ARCH",
"INSTALLTIME",
"SIZE",
"SIGPGP",
"SOURCERPM",
"BUILDTIME",
"BUILDHOST",
"PACKAGER",
"VENDOR",
)
properties = {}
for name in tags:
value = header[
getattr(
rpm,
f"RPMTAG_{name}"
)
]
if name in (
"INSTALLTIME",
"BUILDTIME"
):
value = (
datetime.fromtimestamp(
value,
timezone.utc
)
.isoformat(timespec="seconds")
.replace(
"+00:00",
"Z"
)
)
properties[name] = value
print(
yaml.safe_dump(
properties,
sort_keys=False,
default_flow_style=False,
)
)
~~~

1.

~~~YAML
NAME: code-insiders
VERSION: 1.137.0
RELEASE: 1788539840.el8
ARCH: x86_64
INSTALLTIME: '2026-09-04T22:53:37Z'
SIZE: 1031125129
SIGPGP: !!binary |
iQEcBAABCAAGBQJqmvTwAAoJEOs+lK2+EinPa1EH/3ggnCmqlwa+CfaE3oFlp423JdmWx4BFF2fd
zt6qlR2/5SlGlzUFq2fqm35cpZkcwRIstIvDZG/8czJSe/Z9INYggK0cy9kzEiltEfDqzGoeRpa9
Y88jbWYc/4t0GWe+LooZdxAU/Inx3jKQKIDoI4k/t8np9HvOIikQGthh9RiLba07yDMR/BpQq2dm
uJYUDLSGbh3BoyTvdmTbfMguDOJNgAcXD6l9XYQrRrOt2/UMqjYeIH85COf2jvKrqjGKoRQ5xU9L
AK527aJ/ulfvAQ5Sz1gn64ULRsBERNEhXQsesBt1W7ZINsKFKWi0i6R3RVztwpZzYu9SnhLG129D
opg=
SOURCERPM: code-insiders-1.137.0-1788539840.el8.src.rpm
BUILDTIME: '2026-09-04T16:37:24Z'
BUILDHOST: 21a4ed8ec000005
PACKAGER: Visual Studio Code Team
VENDOR: Microsoft Corporation
~~~

#### OS Version

1.

~~~powershell
#!/usr/bin/env -S pwsh -File
$OSRelease = [Ordered]@{}
Get-Content /etc/os-release | ForEach-Object {
If ($_ -Match '^\s*([^=]+)=(.*)$') {
$Name = $Matches[1]
$Value = $Matches[2]
If ($Value -Match '^"(.*)"$') {
$Value = $Matches[1]
}
If ($Value -Match '^[0-9]+$') {
$Value = [Int64]$Value
}
$OSRelease[$Name] = $Value
}
}
[PSCustomObject]$OSRelease |
Select-Object NAME, VARIANT, VERSION_ID |
Format-List |
yq -P
~~~

1.

~~~yaml
NAME: Fedora Linux
VARIANT: KDE Plasma Desktop Edition
VERSION_ID: 44
~~~

#### Steps To Reproduce It

During one of my conversations, the LLM stated, whilst thinking, that:

> The integrated terminal is still failing before it reaches `git`, due to the wrapper’s `PATH` parsing.

Consequently, I asked it:

> You state that my terminal is failing; are you able to provide me with the full command and its output?

It responded with:

Yes. The failing wrapper command was:

~~~sh
cd '/home/beedell.roke_julian_lockhart/.vscode-insiders/tmp/tmp_vscode_2'; ELECTRON_RUN_AS_NODE=1 PATH="$PATH:/usr/share/code-insiders/resources/app/node_modules.asar.unpacked/@vscode/ripgrep-universal/bin/linux-x64" TMPDIR="/home/beedell.roke_julian_lockhart/.vscode-insiders/tmp/tmp_vscode_2" CLAUDE_TMPDIR="/home/beedell.roke_julian_lockhart/.vscode-insiders/tmp/tmp_vscode_2" "/usr/share/code-insiders/code-insiders" "/usr/share/code-insiders/resources/app/node_modules/@vscode/sandbox-runtime/dist/cli.js" --settings "/home/beedell.roke_julian_lockhart/.vscode-insiders/tmp/tmp_vscode_2/vscode-sandbox-settings-de011741-1752-4a15-9a27-53590a592ade.json" -c 'cd '\''/home/beedell.roke_julian_lockhart/Documents/softwareThatLacksPathSanitisation/git/cSharpQt'\'' && dotnet run --property:QtDir=/tmp/qt-prefix'
~~~

The command it was attempting to run was:

~~~sh
dotnet run --property:QtDir=/tmp/qt-prefix
~~~

The output was:

~~~YAML
ParserError:
Line |
1 | … siders/tmp/tmp_vscode_2'; ELECTRON_RUN_AS_NODE=1 PATH="$PATH:/usr/sha
| ~~~~~~
| Variable reference is not valid. ':' was not followed by a valid variable name character.

PS /home/beedell.roke_julian_lockhart/Documents/softwareThatLacksPathSanitisatio
n/git/cSharpQt>
~~~

The important detail is that the error occurs while PowerShell parses the wrapper’s `PATH="$PATH:/usr/..."` expression. `dotnet run` itself is never reached.

[^1] [^2]

[^1]: [`forum.qt.io/post/839999`](https://forum.qt.io/post/839999)

[^2]: [`orgs/community/discussions/129888#discussioncomment-12917705`](https://github.com/orgs/community/discussions/129888#discussioncomment-12917705)

It advises `bash`, in `pwsh`'s stead. However, I should be able to utilise Microsoft's shell in Microsoft's IDE with Microsoft's programming languages.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.