Bug 242683 - Bad position of cursor in bash
Summary: Bad position of cursor in bash
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: bash
Version: 5.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Tomas Janousek
QA Contact: Chris Ward
Keywords: Reopened
Depends On: 241647 380421
TreeView+ depends on / blocked
Reported: 2007-06-05 13:25 UTC by Stepan Kasal
Modified: 2008-05-21 15:36 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2008-05-21 15:36:00 UTC

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 16:48:21 UTC

Description Stepan Kasal 2007-06-05 13:25:03 UTC
+++ 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 20:25:25 UTC
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 09:06:37 UTC
This is upstream's bash32-016 patch.

Comment 5 RHEL Product and Program Management 2007-10-16 03:58:35 UTC
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 15:36:00 UTC
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.