Comment 2 for bug 1468832

Revision history for this message
Anders Kaseorg (andersk) wrote :

.xsession is sourced within /bin/sh, not /bin/bash. It wouldn’t make sense to source .bashrc from it (unless you happened to write a .bashrc that doesn’t use any bash features).

Also, .bashrc is sourced by _every_ interactive shell, so if you were to add things to environment variables from .bashrc, e.g.
  PATH="$HOME/bin:$PATH"
then they would show up multiple times in shells launched inside shells. This is just an annoyance for $PATH, but it might be an important problem for other variables, so you would need to add code to test whether the variable had already been changed, etc.

This is why Ubuntu’s default .profile (see /etc/skel/.profile) sets up $PATH and the default .bashrc (see /etc/skel/.bashrc) does not.