nRF Connect for VS Code messes up environment variables

Hi,

I have an environment variable with newlines and that is messed up by the VS Code extension. It seems that the extension tries to parse and rewrite the whole environment for some unknown reason. I have the following variables defined among others.

BASH_FUNC_ml%%=() { module ml "$@"
}
BASH_FUNC_which%%=() { ( alias;
eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@
}

When I build inside VS Code i get the following in the terminal.


[301/301] Generating zephyr/merged.hex
/bin/sh: ml: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `ml'
/bin/sh: which: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `which'

nRF Connect SDK extension for VS Code, v2022.7.242.

Why does the extension rewrite my environment in the first place?

Thanks for reminding me to post this issue here.

Parents Reply
  • Thanks.

    These environment variables are set in system files so it's not something I'd like to mess around in. But thanks for sharing that part of the documentation, didn't know about that variable. Can be useful.

    I hope the VS Code team can figure out what is wrong. It doesn't stop med from compiling but it generates annoying noise in the terminal when build.

    At the end of that documentation I found this. Not sure that I understand this correctly. VS Code reads .profile but if I want to disable that feature I should set things i .profile?

    Is this paragraph really correct?

    VS Code picks up environment variables set in .profile. To disable this option while still being compatible with the terminal, move the nRF Connect SDK-specific environment variables (such as ZEPHYR_TOOLCHAIN_VARIANT or GNUARMEMB_TOOLCHAIN_PATH) to .profile.

Children
Related