Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load aliases and environment variables for ansi-term/multi-term?

Tags:

emacs

Do I have to set up something like .emacs.d/init_bash.sh (as for shell-mode), or can it read my ~/.bash_profile directly? If the latter, how do I set configure ansi-term/multi-term to source this file automatically on start-up?

like image 910
hatmatrix Avatar asked Feb 24 '23 00:02

hatmatrix


1 Answers

Only login shells source .bash_profile automatically. Regular shell source only .bashrc. This shouldn't regularly be a problem, however, since all shells are usually spawned from the login shell and therefore inherit its environment. When I use ansi-term it requires no additional setup on my part and functions just like a terminal opened with gnome-terminal, for instance.

like image 100
Bozhidar Batsov Avatar answered Feb 26 '23 14:02

Bozhidar Batsov