From bug-bash-admin@gnu.org  Mon Dec  2 21:47:01 2002
Return-Path: <bug-bash-admin@gnu.org>
Received: from localhost (localhost.localdomain [127.0.0.1])
	by localhost.localdomain (8.12.6/8.12.5) with ESMTP id gB2LkGlU016502
	for <twaugh@localhost>; Mon, 2 Dec 2002 21:47:00 GMT
Received: from devserv.devel.redhat.com [172.16.58.1]
	by localhost with IMAP (fetchmail-6.1.0)
	for twaugh@localhost (single-drop); Mon, 02 Dec 2002 21:47:00 +0000 (GMT)
Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254])
	by devserv.devel.redhat.com (8.11.6/8.11.0) with ESMTP id gB2LWqM32659
	for <twaugh@devserv.devel.redhat.com>; Mon, 2 Dec 2002 16:32:52 -0500
Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31])
	by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id gB2LWqD17546
	for <twaugh@redhat.com>; Mon, 2 Dec 2002 16:32:52 -0500
Received: from monty-python.gnu.org (monty-python.gnu.org [199.232.76.173])
	by mx1.redhat.com (8.11.6/8.11.6) with SMTP id gB2L7xP22894
	for <twaugh@redhat.com>; Mon, 2 Dec 2002 16:07:59 -0500
Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 18Iy9k-0006S8-00; Mon, 02 Dec 2002 16:31:08 -0500
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 18Iy9C-00068Q-00
	for bug-bash@gnu.org; Mon, 02 Dec 2002 16:30:34 -0500
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 18Iy9A-00068F-00
	for bug-bash@gnu.org; Mon, 02 Dec 2002 16:30:33 -0500
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 18Iy9A-00063e-00
	for bug-bash@gnu.org; Mon, 02 Dec 2002 16:30:32 -0500
Received: from nike.ins.cwru.edu (localhost [127.0.0.1]) by nike.ins.cwru.edu with ESMTP (8.12.3/CWRU-2.10-fbsd)
	id gB2LUMrN061394; Mon, 2 Dec 2002 16:30:22 -0500 (EST) (from chet@nike.ins.cwru.edu)
Received: (from chet@localhost)
	by nike.ins.cwru.edu (8.12.3/8.12.3/Submit) id gB2LUM0O061393;
	Mon, 2 Dec 2002 16:30:22 -0500 (EST)
From: Chet Ramey <chet@nike.ins.cwru.edu>
Message-Id: <200212022130.gB2LUM0O061393@nike.ins.cwru.edu>
To: clowenst@ucsd.edu
Subject: Re: last line of output missing in xterms
Newsgroups: comp.unix.shell
In-Reply-To: <156388ec.0212021151.51a48df1@posting.google.com>
References: <pan.2002.12.01.00.38.29.665281@in.hell.optushome.com.au> <3deadd2e$1_3@news.iglou.com>
Organization: Case Western Reserve University, Cleveland, Ohio, USA
Cc: chet@po.cwru.edu, bug-bash@gnu.org
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0.11
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>,
	<mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>,
	<mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-bash/>
Date: Mon, 2 Dec 2002 16:30:22 -0500 (EST)
Status: RO
Content-Length: 3419
Lines: 110

In article <156388ec.0212021151.51a48df1@posting.google.com> you write:

>I have just been investigating this problem, and it's worse than that.
>Somehow bash version 2.05b.0(1) is over-writing every line of output
>from the beginning of the line in order to add one character to the
>end of the line.  A simple example is given by the following:

It has to do with the multibyte locale support.  Try this patch:

*** ../bash-2.05b/lib/readline/display.c	Tue Jun  4 10:54:47 2002
--- lib/readline/display.c	Fri Sep 13 16:22:57 2002
***************
*** 71,75 ****
  
  #if defined (HANDLE_MULTIBYTE)
! static int _rl_col_width PARAMS((char *, int, int));
  static int *_rl_wrapped_line;
  #else
--- 71,75 ----
  
  #if defined (HANDLE_MULTIBYTE)
! static int _rl_col_width PARAMS((const char *, int, int));
  static int *_rl_wrapped_line;
  #else
***************
*** 1349,1355 ****
  	      _rl_output_some_chars (nfd + lendiff, temp - lendiff);
  #if 0
- 	      _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff) - col_lendiff;
- #else
  	      _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
  #endif
  	    }
--- 1349,1355 ----
  	      _rl_output_some_chars (nfd + lendiff, temp - lendiff);
  #if 0
  	      _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
+ #else
+ 	      _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff);
  #endif
  	    }
***************
*** 1511,1516 ****
    /* If we have multibyte characters, NEW is indexed by the buffer point in
       a multibyte string, but _rl_last_c_pos is the display position.  In
!      this case, NEW's display position is not obvious. */
!   if ((MB_CUR_MAX == 1 || rl_byte_oriented ) && _rl_last_c_pos == new) return;
  #else
    if (_rl_last_c_pos == new) return;
--- 1511,1523 ----
    /* If we have multibyte characters, NEW is indexed by the buffer point in
       a multibyte string, but _rl_last_c_pos is the display position.  In
!      this case, NEW's display position is not obvious and must be
!      calculated. */
!   if (MB_CUR_MAX == 1 || rl_byte_oriented)
!     {
!       if (_rl_last_c_pos == new)
! 	return;
!     }
!   else if (_rl_last_c_pos == _rl_col_width (data, 0, new))
!     return;
  #else
    if (_rl_last_c_pos == new) return;
***************
*** 1595,1603 ****
      {
        if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
! 	{
! 	  tputs (_rl_term_cr, 1, _rl_output_character_function);
! 	  for (i = 0; i < new; i++)
! 	    putc (data[i], rl_outstream);
! 	}
        else
  	_rl_backspace (_rl_last_c_pos - new);
--- 1602,1606 ----
      {
        if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
! 	_rl_backspace (_rl_last_c_pos - _rl_col_width (data, 0, new));
        else
  	_rl_backspace (_rl_last_c_pos - new);
***************
*** 2118,2122 ****
  static int
  _rl_col_width (str, start, end)
!      char *str;
       int start, end;
  {
--- 2121,2125 ----
  static int
  _rl_col_width (str, start, end)
!      const char *str;
       int start, end;
  {
***************
*** 2194,2196 ****
  }
  #endif /* HANDLE_MULTIBYTE */
- 	  
--- 2197,2198 ----
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )

Chet Ramey, ITS, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-bash

