I tried to create a .emacs-bash file and that works for M-x shell. But if I use the ansi-term, it appears that the .emacs-bash file is not loaded… How can I solve this?
I used M-x ansi-term and then \bin\bash.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
~/.emacs_SHELLNAME(or~/.emacs.d/init_SHELLNAME.sh) behaviour is special to theshellfunction (which, naturally, knows that you’re going to be running a shell).ansi-termis a terminal emulator. It doesn’t know what kind of process you’re going to be running with it, so it doesn’t attempt to apply any custom config files.If you run a shell in the terminal, that shell should apply its normal rules for config files, so I would try
.bashrcfor starters.Failing that, read the bash man page to see what the rules are. Environment variables would likely come into play (and you could test for environment variables in your .bashrc to provide Emacs-specific behaviour).