Bug 241647 - Bad position of cursor in bash
Summary: Bad position of cursor in bash
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: 7
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
: 155444 (view as bug list)
Depends On:
Blocks: 242683 358231
TreeView+ depends on / blocked
Reported: 2007-05-29 10:42 UTC by Stepan Kasal
Modified: 2008-01-11 22:04 UTC (History)
3 users (show)

Fixed In Version: 3.2-19.fc7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2008-01-11 22:04:37 UTC

Attachments (Terms of Use)

Description Stepan Kasal 2007-05-29 10:42:40 UTC
[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

Comment 1 Miroslav Lichvar 2007-05-29 11:42:38 UTC
Upstream has released a patch that fixes this issue.


Comment 2 Stepan Kasal 2007-06-05 13:19:38 UTC
Thanks a lot!  I hope comment #1 will help the bash maintainer.

Comment 3 Jan Kratochvil 2007-07-04 18:43:25 UTC
Still valid for F7 bash-3.2-9.fc7.

Comment 4 Jan Kratochvil 2007-07-04 18:45:59 UTC
*** Bug 155444 has been marked as a duplicate of this bug. ***

Comment 5 Tim Waugh 2007-07-05 10:06:04 UTC
I've just built bash-3.2-11.fc8 in devel which brings it to patchlevel 17.

Comment 6 Fedora Update System 2007-11-29 01:32:42 UTC
bash-3.2-19.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update bash'

Comment 7 Fedora Update System 2008-01-11 22:04:28 UTC
bash-3.2-19.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

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