Set global $PATH environment variable in VS Code

后端 未结 8 1877
温柔的废话
温柔的废话 2020-12-14 02:28

I\'m defining a custom $PATH environment variable in my ~/.bash_profile (on a Mac), like so:

PATH=\"$HOME/.cargo/bin:$PATH:$HOME/bi         


        
8条回答
  •  星月不相逢
    2020-12-14 02:44

    Getting Code to load your existing ~/.bash_profile would be best. I think the docs here are the relevant reference: https://code.visualstudio.com/docs/editor/integrated-terminal#_linux-os-x

    Typically $SHELL is your primary shell on Unix-like systems so you probably won't want to change the shell. You can pass arguments to the shell when it is launched.

    For example, to enable running bash as a login shell (which runs .bash_profile), pass in the -l argument (with double quotes):

    // Linux "terminal.integrated.shellArgs.linux": ["-l"]

    // OS X "terminal.integrated.shellArgs.osx": ["-l"]

    Although, it looks like that setting is the default on my current VS Code (OS X) setup. Integrated terminal is running my ~/.bash_profile without any changes to the configuration. Perhaps try adding echo Executing .bash_profile... to test if it's running when a new terminal is opened in Code.

提交回复
热议问题