Ok, here's what I did to solve the problem. It is based an answer to this question from StackOverflow, which I found after mixing up my search terms a little bit on Google. I added the following line to
Everything works as it should now.
EDIT: Why the Problem Occurs
I found why you have to explicitly force the BASH shell to read /etc/profile rather than have it read on invocation. Here is the relevant section from the BASH manual (
When an interactive shell that is not a login shell is started, bash reads and executes commands from ˜/.bashrc, if that ﬁle exists. This may be inhibited by using the −−norc option. The −−rcﬁle ﬁle option will force bash to read and execute commands from ﬁle instead of ˜/.bashrc.
One can infer from the way this is written (and what it says about how to invoke login shells before this), is that
shell.el does not invoke a login shell. I've looked for evidence of this in
shell.el and it seems to be true, BASH is invoked with the -i flag (interactive) but not the --login flag. Non-login shells do read .bashrc, so this is why you can work around the problem by putting
source /etc/profile into .bashrc.