Skip to content

Prepending PATH env var with environmentVariableCollection doesn't work on linux for fish #232495

@meganrogge

Description

@meganrogge
          I was having issues with how the VSCode terminal was resolving the PATH variable on my system and I discovered this PR which fixes the execution order of the shell integration and the fish config, which I thought was the cause. In particular I was having this same old issue but on Linux with fish https://github.com/microsoft/vscode/issues/99878 , which was fixed for macOS back in the day.

But despite the fix in this PR, my issue specifically with the PATH wasn't fixed. In particular, I'm using the official fish variable fish_user_paths to handle the PATH in my system. It looks like fish always prepends these paths at the very end of the fish shell setup, even after the initial-command, so the context.environmentVariableCollection.prepend("PATH", "/foo/my/path:"); functionality used by some extensions doesn't work.

I opened a PR on top of this one with the simple fix aravind-n#1
My fix is dependent on the changes on this PR, so if the team thinks this is a valid solution, it could be included in the same PR.

The linked old issue is particularly annoying when working with extensions that let you change the version of a language SDK per project, because the PATH change won't work in the terminal.

Originally posted by @davidmartos96 in #226589 (comment)

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsiderslinuxIssues with VS Code on Linuxterminal-shell-fishAn issue in the terminal specific to fish, including shell integrationverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions