Red Hat Bugzilla – Bug 177661
Bash prompt very slow since bash 3.1
Last modified: 2007-11-30 17:11:20 EST
Description of problem:
Assigning a complicated bash prompt made typing text *much* slower
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Install the attached .bashrc as the user's .bashrc
2. Run a terminal emulator
3. Middle-click to paste a long text (the URL to this bug for example)
You see the characters appearing one-by-one
Text appears instantaneously, as without the custom prompt
I've used this prompt for 5 years, and it was never slow, even on remote
machines from bash 1.something to 3.0. The upgrade to 3.1 seems to have made it
Created attachment 123131 [details]
bashrc with custom prompt
This is intentional and is to work around problems on some terminals.
/* 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. */
Re-opening the bug since Chet Ramey tells me:
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.
Would it be possible to disable this work-around in the meanwhile?
Bash-3.2 is in rawhide now.