From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: [dalias@aerifal.cx: ansi-term \e[J causes spurious newline [revised report]] Date: Thu, 22 Mar 2007 23:00:02 +0100 Message-ID: References: <87zm66o80a.fsf@stupidchicken.com> <200703211840.l2LIem6A013375@oogie-boogie.ics.uci.edu> <87ps724dbd.fsf@stupidchicken.com> <200703212016.l2LKGo67015610@oogie-boogie.ics.uci.edu> <200703220322.l2M3M8Ed022513@oogie-boogie.ics.uci.edu> <200703220508.l2M58fte023654@oogie-boogie.ics.uci.edu> <200703221706.l2MH6WDo003611@oogie-boogie.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1174600862 6557 80.91.229.12 (22 Mar 2007 22:01:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Mar 2007 22:01:02 +0000 (UTC) Cc: Miles Bader , emacs-devel@gnu.org To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 22 23:00:55 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HUVL2-0004L6-PC for ged-emacs-devel@m.gmane.org; Thu, 22 Mar 2007 23:00:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUVMs-0005Ev-4y for ged-emacs-devel@m.gmane.org; Thu, 22 Mar 2007 17:02:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HUVMD-0004sJ-5n for emacs-devel@gnu.org; Thu, 22 Mar 2007 18:02:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HUVMB-0004ra-CK for emacs-devel@gnu.org; Thu, 22 Mar 2007 18:02:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUVMB-0004rW-9x for emacs-devel@gnu.org; Thu, 22 Mar 2007 17:02:03 -0500 Original-Received: from pfepb.post.tele.dk ([195.41.46.236]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HUVKL-0002fc-0v for emacs-devel@gnu.org; Thu, 22 Mar 2007 18:00:09 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx19.adsl-dhcp.tele.dk [80.62.38.68]) by pfepb.post.tele.dk (Postfix) with SMTP id 61F71A5005F; Thu, 22 Mar 2007 23:00:05 +0100 (CET) In-Reply-To: <200703221706.l2MH6WDo003611@oogie-boogie.ics.uci.edu> (Dan Nicolaescu's message of "Thu\, 22 Mar 2007 10\:06\:21 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:68337 Archived-At: Dan Nicolaescu writes: > > The reporter specifically mentioned busybox command line editing. > > Where? The message that I was CCed on only mentioned "echo". Here's the original report. From: Rich Felker Subject: ansi-term \e[J causes spurious newline [revised report] Newsgroups: gmane.emacs.bugs To: bug-gnu-emacs@gnu.org Date: Sun, 18 Mar 2007 19:34:52 -0400 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 side-effects. 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. ~Rich -- Kim F. Storm http://www.cua.dk