As discussed here (and lots of other places), .bashrc is loaded on every shell invocation, whereas .bash_profile is only loaded on login. This suggests loading ProfileGem in .bash_profile would save some parsing time on each new shell interactive session in a given login.
It would have some disadvantages though:
Changes and updates would "regress" in new shells in the same login (shell A runs pgem_update, a newly created shell B would need to run pgem_reload to pick up those changes)
Commands (in commands.sh) would still need to be invoked in .bashrc
It might be possible to support sourcing ProfileGem in both.bash_profile and .bashrc and have it short-circuit in .bashrc if nothing has changed (but still run all commands.sh).
Original report by Michael Diamond (Bitbucket: dimo414).
As discussed here (and lots of other places),
.bashrc
is loaded on every shell invocation, whereas.bash_profile
is only loaded on login. This suggests loading ProfileGem in.bash_profile
would save some parsing time on each new shell interactive session in a given login.It would have some disadvantages though:
pgem_update
, a newly created shell B would need to runpgem_reload
to pick up those changes)commands.sh
) would still need to be invoked in.bashrc
It might be possible to support sourcing ProfileGem in both
.bash_profile
and.bashrc
and have it short-circuit in.bashrc
if nothing has changed (but still run allcommands.sh
).