0

When I load a shell at startup - just using (shell) in my .emacs file - there are always 26 shell prompts "bash-3.2$ bash-3.2$ bash-3.2$...". Why is that happening? This is happening the same way in emacs on a terminal and aquamacs.

Eddy Freddy
  • 1,820
  • 1
  • 13
  • 18
seans
  • 793
  • 2
  • 7
  • 19
  • Try putting a `set -x` at the beginning of your .bash_profile or .bashrc. and a `set +x` at the end of it (assuming you're using bash). This might help you figure out what's being called. – jdd Oct 24 '11 at 01:22
  • 26 reminds me 26 letters of Alphabet. Check something if related. – aartist Oct 24 '11 at 15:11
  • it turns out I have 26 commands in my .bashrc. I wish there were a way to load the shell after loading the .bashrc file, but maybe the shell is what's causing the .bashrc to load. – seans Oct 24 '11 at 15:38
  • ok, scratch that. I started killing things in my .bashrc and the number of shelll prompts increased to 43! Now it's 43 each time. What is going on here? – seans Oct 24 '11 at 16:05
  • Post the contents of your `.bashrc` and of your `.emacs`. Does this happen if you start Emacs with `emacs -q`? – Gilles 'SO- stop being evil' Oct 24 '11 at 22:03
  • if I start emacs with -q it doesn't load the init file, so there's no shell. If I disable my .bashrc file completely I get one shell prompt, so I'm considering .bashrc the culprit. There's nothing complicated in my .bashrc, just a bunch of aliases. – seans Oct 25 '11 at 15:02

1 Answers1

0

Use binary search to narrow things down to find the culprit. Sounds complicated, but it is very fast.

Just comment out half of your init file (.emacs), then a quarter, then an eighth, etc. until you know precisely what part causes the problem. Use any of the keys/commands that comment/uncomment the region to do this. (I use comment-region, which I bind to C-M-;.

Drew
  • 29,895
  • 7
  • 74
  • 104
  • if I create an entirely new .emacs file which contains only (shell), I still get 26 shell prompts. I am now thinking this is caused by my .bashrc getting loaded and firing a shell prompt for each command. – seans Oct 24 '11 at 15:32