[comp.emacs] How do I get rid of ^M in shell mode?

spolsky-joel@CS.Yale.EDU (Joel Spolsky) (02/06/89)

Whenever I run an interactive program in an inferior shell, I get lots
of ^M's and ^@'s showing up all over the place, and everything I type is
echoed (unnecessarily)... This doesn't happen when I am giving
commands to the shell but only when talking to the program.

Has anybody seen this and is there a good way to fix it?

System: GNU-Emacs 18.52 under Sun-OS 4.0...

+----------------+----------------------------------------------------------+
|  Joel Spolsky  | bitnet: spolsky@yalecs.bitnet     uucp: ...!yale!spolsky |
|                | internet: spolsky@cs.yale.edu     voicenet: 203-436-1483 |
+----------------+----------------------------------------------------------+
                                                      #include <disclaimer.h>

jr@bbn.com (John Robinson) (02/07/89)

In article <49771@yale-celray.yale.UUCP>, spolsky-joel@CS (Joel Spolsky) writes:
>
>Whenever I run an interactive program in an inferior shell, I get lots
>of ^M's and ^@'s showing up all over the place, and everything I type is
>echoed (unnecessarily)... This doesn't happen when I am giving
>commands to the shell but only when talking to the program.
>
>Has anybody seen this and is there a good way to fix it?

You are running a program that thinks it is talking interactively to a
full-duplex terminal.  You may or may not be able to convince it
otherwise, depending.  Some shells, like tcsh, can't be dissuaded from
this behavior.

There have been suggested changes to shell-mode that make it behave
more like telnet-mode.  What the latter does is to erase your typein
from the buffer as it sends it, and let the remote host's echo print
it back.  In addition it filters out ^M's (I don't know about ^@'s).
So one solution is to telnet to yourself instead of using shell-mode,
else get the changes I mentioned above.

Finally, you can try to run terminal.el, but I would expect that a
program that "knew better" would not be willing to obey the terminal
model that provides; however it is worth a shot.
--
/jr
jr@bbn.com or bbn!jr