[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ansi-term \e[J causes spurious newline [revised report]

From: Rich Felker
Subject: ansi-term \e[J causes spurious newline [revised report]
Date: Sun, 18 Mar 2007 19:34:52 -0400
User-agent: Mutt/

On versions of GNU emacs I have tested (21.1 and cvs unicode-2
branch), the "ansi-term" terminal emulator (M-x ansi-term) exhibits
incorrect terminal behavior when given the ESC [ J sequence. In
addition to clearing to the end of the screen, it moves the cursor to
the beginning of the next line if the cursor is not already at the
beginning of a line. To test this, use the following shell command
from a shell running in ansi-term:

echo -e 'hello\e[Jworld'

On a vt100/ansi/ecma compatible terminal, this should leave
"helloworld" visible on the screen, with everything afterward cleared.
On GNU emacs' ansi-term, it prints hello on one line and world on the
next, after clearing to the end of the screen.

This bug makes busybox shells' cmdedit functionality essentially
unusable, since it depends on ESC [ J leaving the cursor in the
correct position. Other programs may be affected too.

Removing the calls to term-unwrap-line from term-erase-in-display (in
term.el) fixes the problem, but I don't know if this has any bad

Also, in reading this code, I noticed that the sequence ESC [ 1 J
seems to only erase up to the point. To emulate VT100's Roman-inspired
off-by-one idiosyncracies, it should erase up to point+1, i.e. also
erase the character "under" the terminal cursor.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]