Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 242683 - Bad position of cursor in bash
Bad position of cursor in bash
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: bash (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tomas Janousek
Chris Ward
: Reopened
Depends On: 241647 380421
  Show dependency treegraph
Reported: 2007-06-05 09:25 EDT by Stepan Kasal
Modified: 2008-05-21 11:36 EDT (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2008-0380
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-21 11:36:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0380 normal SHIPPED_LIVE bash bug fix update 2008-05-20 12:48:21 EDT

  None (edit)
Description Stepan Kasal 2007-06-05 09:25:03 EDT
+++ This bug was initially created as a clone of Bug #241647 +++

[This is a problem with readline compiled into bash; I chose to file it against
readline, hoping that its maintainer might know how to fix it. ;-]

Description of problem:
The cursor position is wrong after serach in commandline history.

Version-Release number of selected component (if applicable):
$ rpm -q bash && bash --version
GNU bash, version 3.1.17(1)-release (i686-redhat-linux-gnu)

How reproducible:

Steps to Reproduce:
0. bash
2. PS1='\[\e[?17;15;175c\]{some_ps1_text}:'
3. ctrl-R (start incremental search backwards)
4. ctrl-G (cancel it)

Expected results:
The cursor shall be positioned just after the prompt text.

Actual results:
The cursor is positioned on letter `m' in the middle of the prompt text

Additional info:
Note that my PS1 contains a non-printing control sequence; it is enclosed in
\[...\] pair, to tell readline about it. With C locale, this mechanism works,
but it seems it does not work with utf-8 locales.

Actually the cursor is positioned 13 characters to the left from the correct
position.  And 13 is the length of the non-printing sequence in the prompt.  I
have tried a shorter non-printing sequence and again, the skew was equal to its

-- Additional comment from mlichvar@redhat.com on 2007-05-29 07:42 EST --
Upstream has released a patch that fixes this issue.


-- Additional comment from skasal@redhat.com on 2007-06-05 09:19 EST --
Thanks a lot!  I hope comment #1 will help the bash maintainer.
Comment 1 RHEL Product and Program Management 2007-06-05 16:25:25 EDT
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Since this
bugzilla is in a component that is not approved for the current
release, it has been closed with resolution deferred.  You may
reopen this bugzilla for consideration in the next release.
Comment 3 Tim Waugh 2007-07-05 05:06:37 EDT
This is upstream's bash32-016 patch.
Comment 5 RHEL Product and Program Management 2007-10-15 23:58:35 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 10 errata-xmlrpc 2008-05-21 11:36:00 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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