Bug 241647 - Bad position of cursor in bash
Bad position of cursor in bash
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
: 155444 (view as bug list)
Depends On:
Blocks: 242683 358231
  Show dependency treegraph
Reported: 2007-05-29 06:42 EDT by Stepan Kasal
Modified: 2008-01-11 17:04 EST (History)
3 users (show)

See Also:
Fixed In Version: 3.2-19.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-11 17:04:37 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Stepan Kasal 2007-05-29 06:42:40 EDT
[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 07:42:38 EDT
Upstream has released a patch that fixes this issue.

Comment 2 Stepan Kasal 2007-06-05 09:19:38 EDT
Thanks a lot!  I hope comment #1 will help the bash maintainer.
Comment 3 Jan Kratochvil 2007-07-04 14:43:25 EDT
Still valid for F7 bash-3.2-9.fc7.
Comment 4 Jan Kratochvil 2007-07-04 14:45:59 EDT
*** Bug 155444 has been marked as a duplicate of this bug. ***
Comment 5 Tim Waugh 2007-07-05 06:06:04 EDT
I've just built bash-3.2-11.fc8 in devel which brings it to patchlevel 17.
Comment 6 Fedora Update System 2007-11-28 20:32:42 EST
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 17:04:28 EST
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.