Shell mode: suggest adding newline when carriage return printed

Ed Avis <[email protected]>
Newsgroups gmane.emacs.xemacs.general
Message-ID <[email protected]>
This bug report will be sent to the XEmacs Development Team,
 not to your local site managers!!
Please write in English, because the XEmacs maintainers do not have
translators to read other languages for them.

In XEmacs 21.1 (patch 8) "Bryce Canyon" [Lucid] (i386-redhat-linux) of Mon Feb 14 2000 on porky.devel.redhat.com
configured using `configure i386-redhat-linux --with-gnu-make --with-gpm=no --with-sound=none --with-pop --mail-locking=flock --with-clash-detection --debug=no --error-checking=none --prefix=/usr --lockdir=/var/lock/xemacs --with-x11 --with-dialogs=athena3d --with-scrollbars=lucid --with-menubars=lucid --with-xpm --with-mule=no --dynamic=yes --with-tty=yes --with-ncurses'

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

Some programs try to produce a pretty display by printing carriage
return (^M) and overwriting the current line.  In XEmacs's shell mode,
however, the carriage return is printed as ^M with no new line
started, so the display comes out looking like

^M                                                                             ^Mt/test_filters....ok 1/60^M                                                                             ^Mt/test_filters....ok 2/60^M                                                                             ^Mt/test_filters....ok 3/60^M

The intended effect is a moving counter that changes from 1/60 to 2/60
and so on, but in a shell buffer it comes out as one long line with
control characters.

Perhaps the bug is with the program that produces the carriage returns
- perhaps it should check the value of $TERM before printing such
strange characters.  This would certainly be true if it were using
ANSI escape sequences for colours or cursor positioning or other
strange things.  But I don't think it's the case here; CR is an ASCII
standard character after all, and it's not unreasonable for a program
to print it and expect its terminal to do something sensible.

Suggested fix is for M-x shell to start a new line after each solitary
CR character.  Then the output from the command would look like

^M
                                                                             ^M
t/test_filters....ok 1/60^M
                                                                             ^M
t/test_filters....ok 2/60^M
                                                                             ^M
t/test_filters....ok 3/60^M

which, while not as cute as a real terminal, is readable.

Recent keystrokes:

ESC O C ESC O C ESC O C ESC O C ESC O C ESC O C C-g 
C-x k RET d a t e SPC - - v e t r s DEL DEL DEL r s 
i o n RET C-x b RET T Z = B S T SPC m a k e SPC t e 
s t RET ESC x r e p o r t - x e m a c s - b u g RET 
DEL DEL DEL DEL DEL DEL DEL DEL DEL DEL e m SPC b u 
SPC RET


Recent messages (most recent first):

Loading emacsbug...done
Loading emacsbug...
Quit
M-[ not defined.
History item: 1
History item: 1
space = page forward; b = page back; h = help; q = quit.
man date (done.)
man date (cleaning...)
man date (running...)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.