Subject: bug#9961: Subject: 24.0.91; shell prompt doubled

From: Colin Baxter <[email-masked]>
Date: Tue, 25 Aug 2020 14:26:37 +0100

>>>>> Lars Ingebrigtsen <[email-masked]> writes:

    > (I think I sent this one prematurely once already; sorry.)  Glenn
    > Morris <[email-masked]> writes:

    >> This issue occurs since at least Emacs 21.1.  If you have a
    >> non-empty ~/.emacs_bash file, eg one that contains just:
    >> 
    >> #comment
    >> 
    >> and do M-x shell with the bash shell, then you get an extra N
    >> copies of your prompt, as the N lines of ~/.emacs_bash are fed to
    >> the shell by comint-exec.

    > This bug is still present in Emacs 28, although it looks a bit
    > different now:

    > I poked around to see whether there's any easy way to fix this:
    > Like a way to say to comint "send this to the process, but discard
    > the output", but there doesn't seem to be?

This works for me. Create a ~/.emacs_bash as:

 # -*- mode: sh; -*-
 # echo ""
 printf '\r\n%.0s' {1..50} ## This clears screen and puts prompt at bottom

There will only be one prompt. For csh, touch the file ~/.emacs_csh but
keep empty.

Best wishes,

Colin Baxter.