How to solve shell initialization conflicts

nRF Connect for VS Code

tags
nRF Connect for VS Code

You may receive a warning message in the extension about shell initialization conflicts when opening a built-in terminal with the nRF Connect profile.

This warning appears when the built-in terminal starts the shell with the default settings for the operating system and sets the shell environment to the toolchain and SDK versions it is supposed to use, but then the local shell initialization script (for example, .bashrc) overrides the SDK environment. As a result, the extension fails to verify and validate the terminal environment.

This conflict can happen for different reasons that are too varied to list here. For example, your local shell initialization script could add environment variables to the system PATH that conflict with the SDK environment, such as custom Python environment, or you could set the ZEPHYR_BASE environment variable in your shell initialization script and thus override the required ZEPHYR_BASE value.

To fix this issue, if there is no need for external terminals to use the ZEPHYR_BASE variable, you can remove this variable from your shell initialization script (such as .bashrc) or move it to an equivalent script that is only loaded by login shells (such as .bash_profile). With regard to PATH, make sure that environment variables listed there do not conflict with the SDK environment.

If you still have issues, visit the Nordic Semiconductor DevZone.