You are not logged in.
I use visual-studio-code-bin, and have noticed that it doesn't load the environment variables found in my `.bashrc` when I launch it from a desktop environment (e.g. dmenu on i3, or in Cinnamon's app menu). For example, here's what I get when I try to run clangd inside a dmenu-launched code session:
<lots of irrelevant output>
/home/cjdb/opt/bin/clangd: error while loading shared libraries: libc++.so.2: cannot open shared object file: No such file or directory
If I instead launch code from a terminal, then my `.bashrc` environment variables get loaded into VS Code, and clangd will work without a problem. I can't seem to work out how to resolve this issue on Arch Linux; although I don't experience this issue on Ubuntu, so there might be a config issue on my end.
I haven't been able to find anything on the wiki or in the forum's history. Does anyone have any pointers on what to do here?
Last edited by cjdb (2024-03-18 00:21:26)
Offline
Your bashrc is for interactive shells and is not loaded or interpreted when you start your graphical session from a display manager, you'd pick a more global spot, like /etc/environment or /etc/profile or some more general user specific location, all of which is described in https://wiki.archlinux.org/title/Environment_variables
Offline
Thank you, this has solved a long-running issue. I also appreciate that it gives a potential reason why this "just works" on Ubuntu: SDDM apparently sources .bashrc files too.
For i3, editing my .xprofile seems to have worked.
Offline