Why ubuntu doesn't start from the first bash
Apparently WSL starts bash as a login shell. Among other things, this means it reads (in order of preference) your ~/.bash_profile
and .profile
files. Your subsequently invoked bash
command is invoked as an interactive non-login shell and hence ignores those startup files and instead reads your ~/.bashrc
(which is presumably where you have done your conda setup).
Regular desktop Ubuntu tries to make non-login and login shells more similar by adding a section to the default ~/.profile
that
-
checks if the shell is bash (not sh, or zsh, or some other shell)
-
if so sources the user's
~/.bashrc
file
WSL appears to provide its own minimal ~/.profile
that does not do this - but if it bothers you, you could
-
backup your current file:
cp ~/.profile ~/.profile.bak
-
copy the default Ubuntu one from the
/etc/skel
directory:cp /etc/skel/.profile ~/
or (possibly better), create a ~/.bash_profile
if you haven't already got one, and source ~/.bashrc
from there.