Bash prompt very slow since bash 3.1

2006-04-24 Thread Bastien Nocera
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: i386-redhat-linux-gcc Compilation CFLAGS:  -DPROGRAM='bash' -
DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-
redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale'
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib
-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -
Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-
buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-
tables uname output: Linux wyatt.hadess.net 2.6.15-1.1928_FC5 #1 Thu Feb
9 23:27:55 EST 2006 i686 i686 i386 GNU/Linux
Machine Type: i386-redhat-linux-gnu

Bash Version: 3.1
Patch Level: 17
Release Status: release

Description:
Assigning a complicated bash prompt made typing text *much*
slower

Repeat-By:
1. Install the following .bashrc as the user's .bashrc
--8<--
C1="\[\033[1;36m\]"
C2="\[\033[0;39m\]"
C3="\[\033[1;30m\]"
C4="\[\033[0m\]"


case $TERM in
xterm*|rxvt*)
PS1="$C4\[\033];[EMAIL PROTECTED]($C4\w$C3)$C4$C1-> $C4"
PS2="$C3-$C4 "
;;
esac

unset C1 C2 C3 C4
--8<--
2. Run a terminal emulator
3. Middle-click to paste a long text (the URL to this bug for
example)


The following comment shows that this is to work-around
with some broken types of terminal:

  /* If this is the first line and there are invisible characters in the
 prompt string, and the prompt string has not changed, and the
current
 cursor position is before the last invisible character in the
prompt,
 and the index of the character to move to is past the end of the
prompt
 string, then redraw the entire prompt string.  We can only do this
 reliably if the terminal supports a `cr' capability.

 This is not an efficiency hack -- there is a problem with redrawing
 portions of the prompt string if they contain terminal escape
 sequences (like drawing the `unbold' sequence without a
corresponding
 `bold') that manifests itself on certain terminals. */

-- 
Bastien Nocera <[EMAIL PROTECTED]> 
I liked the glamour of Hollywood when I first came here, and I guess I
still do. -- Jack Nicholson



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: Bash prompt very slow since bash 3.1

2006-04-24 Thread Bastien Nocera
On Mon, 2006-04-24 at 16:02 -0400, Chet Ramey wrote:
> > Bash Version: 3.1
> > Patch Level: 17
> > Release Status: release
> > 
> > Description:
> > Assigning a complicated bash prompt made typing text *much*
> > slower
> 
> Yes, there is a problem with redrawing the prompt multiple times per
> character in bash-3.1.  Things will be improved in bash-3.2.

Great, thanks for the notice.

-- 
Bastien Nocera <[EMAIL PROTECTED]> 



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash