Help debug Emacs term newline quirk



In the recent version of julia-repl, my Emacs mode for interacting with a Julia process, I have managed to make error locations “clickable” by not breaking lines that are longer than the screen, with (setq term-suppress-hard-newline t).

The problem is that this interacts badly with Julia (see screencast below): the characters that run over show up in random places. Note that I am not saying this is a Julia bug, it could be term.el in Emacs (which has its fair share of quirks). I just need help with understanding what is going on on the Julia side. I want to figure this out to solve it myself or at least make a helpful bug report somewhere, but don’t know how to start. Any advice on how to dig into this from the Julia side would be appreciated.

How to reproduce:

  1. start Emacs with
emacs -q -nw --eval '(progn (setq term-suppress-hard-newline t) (ansi-term "julia"))'

preferably in a terminal that is not too wide so that you don’t have to type much (works in graphical mode without the -nw, too).

  1. Type something that wraps. You can also eval it, then recall with up, etc.



My god asciinema is brilliant.

I don’t think it’s julia’s fault. I also get weirdness with bc:

Over the years I got tons of bugs similar to this with emacs’ term mode, so I just gave up and use the inferior shells instead. Not that it doesn’t have its problems (half the time when I C-c a program in the middle of printing output it just crashes the buffer…)


Thanks, I am also pretty sure it is Emacs’s ansi-term, but understanding what is going on would allow me to try for a workaround.

How do you manage with inferior shells? AFAICT terminal is needed for ASTIntepreter2, the interactive functionality of Pkg3, etc.


I don’t use those packages (yet). ESS wraps pretty much all the functionality I need (e.g. help with “?”).