Bug 177661 - Bash prompt very slow since bash 3.1
Bash prompt very slow since bash 3.1
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
: Reopened
Depends On: 217463
Blocks: FC7Target
  Show dependency treegraph
Reported: 2006-01-12 13:55 EST by Bastien Nocera
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 3.2-3.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-01-22 07:39:22 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
bashrc with custom prompt (209 bytes, text/plain)
2006-01-12 13:55 EST, Bastien Nocera
no flags Details

  None (edit)
Description Bastien Nocera 2006-01-12 13:55:04 EST
Description of problem:
Assigning a complicated bash prompt made typing text *much* slower

Version-Release number of selected component (if applicable):

How reproducible:
Every time

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)

Actual results:
You see the characters appearing one-by-one

Expected results:
Text appears instantaneously, as without the custom prompt

Additional info:
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
much slower.
Comment 1 Bastien Nocera 2006-01-12 13:55:04 EST
Created attachment 123131 [details]
bashrc with custom prompt
Comment 2 Tim Waugh 2006-01-13 12:38:10 EST
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. */
Comment 3 Bastien Nocera 2006-04-24 16:02:44 EDT
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?
Comment 4 Tim Waugh 2007-01-22 07:39:22 EST
Bash-3.2 is in rawhide now.

Note You need to log in before you can comment on or make changes to this bug.