0

When I run VS Code from Ubuntu graphical interface, and do echo $PATH, I see something like

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/abdelghani/.opam/4.14.1/bin

but when I execute echo $PATH from the console, the result is different:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

This causes crashes in some extension I am using.

Why is the $PATH in VS Code different from the one in the terminal and how to configure the path when VS Code is launched from the GUI?

4
  • What research have you done? I just had to google your question title plus "ubuntu" to find useful results, like How to add a directory to the PATH? - Ask Ubuntu. The top answer there talks about using ~/.profile, which is the standard way and it sounds like you're not doing. Commented Oct 14 at 13:25
  • 1
    Thx @wjandrea. The confusion comes from the title has been edited. I am asking about customizing the PATH specificaly for VS code. I edited .profile and .bashrc correctly but VS code seems to use a different PATH which breaks every thing (besides I would like to understand who it works in general) Commented Oct 14 at 14:42
  • Could you clarify, do you want ~/.opam/... in the PATH or not? (E.g. are your extensions crashing because they're not finding executables they need, or because they're finding executables they shouldn't) Commented Oct 14 at 15:33
  • It would help to clarify how exactly you edited your config files. For one thing, I'm not sure why you edited your .bashrc. Commented Oct 14 at 15:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.