GNU bug report logs - #1469
term.el regression when dealing with long lines under bash

Previous Next

Package: emacs;

Reported by: Cyril Bouthors <cyril <at> bouthors.org>

Date: Tue, 2 Dec 2008 14:10:04 UTC

Severity: normal

Tags: patch

Done: Dan Nicolaescu <dann <at> ics.uci.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 1469 in the body.
You can then email your comments to 1469 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1469; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Cyril Bouthors <cyril <at> bouthors.org>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Cyril Bouthors <cyril <at> bouthors.org>
To: emacs-pretest-bug <at> gnu.org
Cc: rfrancoise <at> debian.org, Dimitri Fontaine <dfontaine <at> hi-media.com>
Subject: term.el regression when dealing with long lines under bash
Date: Tue, 02 Dec 2008 14:35:17 +0100
term-mode is no longer able to handle long lines correctly with bash
under emacs-snapshot as it used to work under emacs22.

When a line wider than $COLUMNS+2 is displayed on the terminal, the
cursor is locked on the current line and does not move anymore until
/usr/bin/reset is ran.

I've been able to reproduce this bug when running bash, psql or csh
but not with zsh nor ksh.

I haven't been able to reproduce it under emacs22 at all.

Here's a short procedure to reproduce the bug:
 - Start Emacs: emacs-snapshot -Q
 - Start bash under term-mode: `M-: (term "/bin/bash") RET'
 - Display a long line under bash:
          width=$(($COLUMNS+2))
       for a in $(seq $width); do echo -n X; done; echo
 - Try to type any command on the terminal and you'll see the strange
   cursor behaviour

Long lines typically happen on a daily basis when your are reading
logfiles, running SQL queries, etc.

I hope I provided you with enough information.

In GNU Emacs 23.0.60.1 (x86_64-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2008-11-29 on elegiac, modified by Debian
 (emacs-snapshot package, version 1:20081129-1)
Windowing system distributor `The X.Org Foundation', version 11.0.10502000
configured using `configure  '--build' 'x86_64-linux-gnu' '--host'
'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib'
'--libexecdir=/usr/lib' '--localstatedir=/var'
'--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes'
'--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.60/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.60/site-lisp:/usr/share/emacs/site-lisp'
'--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=x86_64-linux-gnu'
'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN
-DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed'
'CPPFLAGS=''

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Term

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<return> <return> <up> <return> <return> <return> <return>
<return> <S-return> <return> C-d M-x <up> t e r m <return>
<up> <M-backspace> b a s h <M-backspace> t c s <M-backspace>
c s h <return> <return> <return> <return> <return>
/ b i <backspace> <backspace> <backspace> . / b u <tab>
<tab> <backspace> <backspace> g / l o n g - l i n e
s . s h <return> <return> <return> <return> <return>
C-d M-x <up> <return> <up> <down> <up> C-g C-d M-x
b u <backspace> <backspace> r e p o r t - e m a c s
<tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit
#<buffer *terminal*>

-- 	
Cyril Bouthors





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1469; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "richardeng" <richardeng <at> foxmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #10 received at 1469 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "richardeng" <richardeng <at> foxmail.com>
To: "1469" <1469 <at> debbugs.gnu.org>
Subject: Re: bug#1469 Does anybody working on it?
Date: Sun, 7 Dec 2008 22:08:56 +0800
I have spent some time on it. Fix is not found yet.
I'm sure:
1. problem only in M-x term and M-x ansi-term(both in term.el), M-x shell or M-x eshell(in shell.el or eshell/*.el) works right.
2. The default setting is term-char-mode in term.el, if you change it to term-line-mode, no such problem
3. Problem should be wrong local state(position or coloumn/width/height limitation) after wrap action in function term-emulate-terminal

It's real complex, if somebody is working on it, please share what you found.
Thank you

And Cyril Bouthors, you can temporarily use M-x shell instead of M-x term.






Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1469; Package emacs. Full text and rfc822 format available.

Message #13 received at 1469 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: richardeng <richardeng <at> foxmail.com>
Cc: 1469 <at> debbugs.gnu.org
Subject: Re: bug#1469: Does anybody working on it?
Date: Sun, 7 Dec 2008 10:17:57 -0800 (PST)
"richardeng" <richardeng <at> foxmail.com> writes:

  > I have spent some time on it. Fix is not found yet.
  > I'm sure:
  > 1. problem only in M-x term and M-x ansi-term(both in term.el), M-x shell or M-x eshell(in shell.el or eshell/*.el) works right.
  > 2. The default setting is term-char-mode in term.el, if you change it to term-line-mode, no such problem
  > 3. Problem should be wrong local state(position or coloumn/width/height limitation) after wrap action in function term-emulate-terminal
  > 
  > It's real complex, if somebody is working on it, please share what you found.

Reverting this patch seems to fix the problem:

2008-09-24  Andreas Politz  <politza <at> fh-trier.de>  (tiny change)

            * term.el (term-emulate-terminal): Encode input string
            before
            checking its length.


Another thing, the original bug does not seem to be archived on
gmane.emacs.bug, just this reply...




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1469; Package emacs. (Fri, 26 Dec 2008 21:20:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicholas Maniscalco <nicholas <at> maniscalco.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 26 Dec 2008 21:20:04 GMT) Full text and rfc822 format available.

Message #18 received at 1469 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Nicholas Maniscalco <nicholas <at> maniscalco.com>
To: 1469 <at> debbugs.gnu.org
Subject: patch for term.el regression when dealing with long lines under bash
Date: Fri, 26 Dec 2008 13:12:16 -0800
[Message part 1 (text/plain, inline)]
(I sent this to the wrong list earlier.  Resending to, hopefully, the 
right place this time.)

Here's a patch for bug#1469 (term.el regression when dealing with long 
lines under bash).

* term.el (term-emulate-terminal): Decode substring just prior to 
inserting it.  (Bug#1469)

bug#1469 was introduced while fixing bug#1006.  I verified this patch 
against the repro steps in bug#1006 to make sure I haven't made a 
regression.

Can someone please review?  I'd appreciate any feedback.

-- Nicholas
[term.el.patch (text/x-patch, inline)]
Index: lisp/term.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/term.el,v
retrieving revision 1.107
diff -c -p -r1.107 term.el
*** lisp/term.el	3 Dec 2008 05:48:33 -0000	1.107
--- lisp/term.el	25 Dec 2008 03:45:24 -0000
*************** See `term-prompt-regexp'."
*** 2834,2840 ****
  			  ;; following point if not eob nor insert-mode.
  			  (let ((old-column (current-column))
  				columns pos)
! 			    (insert decoded-substring)
  			    (setq term-current-column (current-column)
  				  columns (- term-current-column old-column))
  			    (when (not (or (eobp) term-insert-mode))
--- 2834,2840 ----
  			  ;; following point if not eob nor insert-mode.
  			  (let ((old-column (current-column))
  				columns pos)
! 				(insert (decode-coding-string (substring str i funny) locale-coding-system))
  			    (setq term-current-column (current-column)
  				  columns (- term-current-column old-column))
  			    (when (not (or (eobp) term-insert-mode))

Reply sent to Dan Nicolaescu <dann <at> ics.uci.edu>:
You have taken responsibility. (Sat, 27 Dec 2008 17:30:02 GMT) Full text and rfc822 format available.

Notification sent to Cyril Bouthors <cyril <at> bouthors.org>:
bug acknowledged by developer. (Sat, 27 Dec 2008 17:30:03 GMT) Full text and rfc822 format available.

Message #23 received at 1469-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: Nicholas Maniscalco <nicholas <at> maniscalco.com>
Cc: 1469-done <at> debbugs.gnu.org
Subject: Re: bug#1469: patch for term.el regression when dealing with long lines under bash
Date: Sat, 27 Dec 2008 09:24:40 -0800 (PST)
Nicholas Maniscalco <nicholas <at> maniscalco.com> writes:

  > (I sent this to the wrong list earlier.  Resending to, hopefully, the
  > right place this time.)
  > 
  > Here's a patch for bug#1469 (term.el regression when dealing with long
  > lines under bash).
  > 
  > * term.el (term-emulate-terminal): Decode substring just prior to
  > inserting it.  (Bug#1469)
  > 
  > bug#1469 was introduced while fixing bug#1006.  I verified this patch
  > against the repro steps in bug#1006 to make sure I haven't made a
  > regression.
  > 
  > Can someone please review?  I'd appreciate any feedback.

Thanks, I checked this in.




Merged 1469 1699. Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> emacsbugs.donarmstrong.com. (Wed, 31 Dec 2008 02:25:03 GMT) Full text and rfc822 format available.

Tags added: patch Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> emacsbugs.donarmstrong.com. (Wed, 31 Dec 2008 02:25:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Wed, 28 Jan 2009 15:24:05 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 23 Jan 2010 01:10:03 GMT) Full text and rfc822 format available.

Disconnected #1469 from all other report(s). Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 23 Jan 2010 01:10:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <bug-gnu-emacs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 20 Feb 2010 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 125 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.