I've been building and running Emacs 25 prereleases on a recent Fedora system that I usually access via ssh. I usually run this emacs in a terminal, and I'm fond of using ansi-term inside it.

I've noticed something frustrating when using ansi-term sessions inside this emacs 25-in-a-terminal-ansi-term: newlines generated by the shell in ansi-term often get eaten, particularly when I use readline interaction in the sub-terminal.

To reproduce:

$ emacs -Q -nw # either over ssh or in a virtual terminal in an X environment
M-x ansi-term <enter> <enter> # runs /bin/bash for me
<ansi-term prompt> $ ls # works fine
# normal ls output, newlines intact
<ansi-term prompt> $ <ctrl-r> l s <enter> # r-search, causes problem
# output rendered on same line, followed by prompt overwriting the output

I diagnose the problem as emacs rendering all of the newlines from the shell as \r.

ctrl-l inside the terminal seems to fix this, and I don't believe I've seen it happen unless I use the readline commands in bash.

I didn't notice this in Emacs 24.5, which is what I used prior to this. I'm currently on emacs-25.0.93 and have been following development some to see if this is fixed.

I'm not able to reproduce it without -nw (i.e. in an X frame of emacs); things work as expected.

It's a fiddly, specific case, but it's something that I affects me and I don't know enough about comint and emacs internals to diagnose myself. Any thoughts?

Edit: solved! I built a newer version and it works. Didn't bisect for the changeset. Thanks, folks.

  • Does it break in the GUI if you set the width of one of the fringes to 0 (so that Emacs reserves one column for the continuation glyph)? – Lindydancer Apr 28 '16 at 21:31
  • 1
    M-x report-emacs-bug when you find a bug with a pre-release version of Emacs. (Well, with any version; but especially with pre-releases, when there's an opportunity to fix problems before the official release!) – phils Apr 29 '16 at 10:19
  • I'm unable to reproduce this ( of 29 April). – jch Apr 29 '16 at 15:15
  • The latest pre-test is 25.0.94. I'll try to replicate this when I get to a computer. – Kaushal Modi May 26 '16 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.