Bug 463880 - bash completion in UTF8 locale has cursor positioning errors with long $PS1
bash completion in UTF8 locale has cursor positioning errors with long $PS1
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: bash (Show other bugs)
5.2
All Linux
medium Severity medium
: rc
: ---
Assigned To: Roman Rakus
BaseOS QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-25 00:15 EDT by Tim Connors
Modified: 2014-01-12 19:07 EST (History)
5 users (show)

See Also:
Fixed In Version: bash-3.2-25.el5
Doc Type: Bug Fix
Doc Text:
When the tab key was pressed for auto-completion options for the typed text, the cursor moved to an unexpected position on a previous line if the prompt contained unviewable characters and a "\]". This is now fixed to retain the cursor at the expected position at the end of the target line after autocomplete options correctly display.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-07-21 06:37:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Backported bash32-027 patch from upstream (2.23 KB, patch)
2011-01-18 10:07 EST, Roman Rakus
no flags Details | Diff

  None (edit)
Description Tim Connors 2008-09-25 00:15:43 EDT
Description of problem:

I suspect this is the same as bug https://bugzilla.redhat.com/show_bug.cgi?id=249987 for fedora.

I recently moved over to a UTF-8 environment from ISO-8859, such that LANG=LC_MESSAGES=en_AU.UTF-8
My PS1 is a multiline one, with:
$?-\j-\t, \d \[ESC[33;1m\]\u\[ESC[0m\]@\[ESC[34m\]aatlxz\[ESC[0m\]:\w (bash)\n\[ESC[7m\]\!,\#>\[ESC[m\]
(ie, I have correctly wrapped non printing characters in \[...\], and you'll have to expand those ESC characters to reproduce this)

As soon as I logged in with UTF-8 settings, my prompt would occasionally get messed up with the cursor being positioned on the line above in a strange location.  I just tracked it down to the random occasions when my fingers would do tab-completion for me - it would reproducably get the cursor wrong.  If I set LC_MESSAGES=$LANG=en_AU (ie, straight ISO-8859-1) in the same bash session, then the cursor positioning error goes away.  If I copy a bash from a debian sid version, (version GNU bash, version 3.2.39(1)-release (x86_64-pc-linux-gnu)), then the error went away.  It only appears with the the current redhat version (ie, no bug in 3.00.15(1)-release on a centos 4 box I am on)

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

3.2.25(1)-release

How reproducible:

with the above $PS1 and $LANG and $LC_MESSAGES:
0-0-14:07:05, Thu Sep 25 twc@aatlxz:~ (bash)
79953,1> echo $BASH_VERSION 
3.2.25(1)-release
0-0-14:11:43, Thu Sep 25 twc@aatlxz:~ (bash)
79954,2> getent passwd<position cursor here and press tab> | grep -i star

Actual results:

line half draws on line above, and cursor is placed in the right hand column of the screen.  Screen then ends up horribly confused if you invoke commandline history by pressing the up arrow.  Does not become unconfused until you press enter (ie, even ctrl-C,ctrl-U, or a keyboard binding for redraw-current-line etc fail to reposition the cursor properly)

Expected results:

Tab expansion happens and cursor is placed after the expanded text with possible completions

Additional info:
Comment 1 Roman Rakus 2008-09-30 08:42:36 EDT
backporting patch bash32-027 from rawhide fix this problem.
Comment 2 RHEL Product and Program Management 2009-03-26 12:53:34 EDT
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 3 RHEL Product and Program Management 2009-11-06 13:49:36 EST
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 5 RHEL Product and Program Management 2010-08-09 14:36:18 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 6 RHEL Product and Program Management 2011-01-11 16:01:38 EST
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 7 RHEL Product and Program Management 2011-01-11 17:18:54 EST
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.
Comment 8 Roman Rakus 2011-01-18 10:07:59 EST
Created attachment 474069 [details]
Backported bash32-027 patch from upstream
Comment 9 Roman Rakus 2011-02-10 10:00:03 EST
Fixed in bash-3.2-25.el5
Comment 11 Misha H. Ali 2011-04-20 04:50:09 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When the tab key was pressed to display completion options for text, the cursor would move to an unexpected position on a line before the target line if the prompt contained characters not directly viewable followed by a "\]". This is now corrected to retain the cursor at the expected location at the end of the target line after autocomplete options correctly display.
Comment 12 Misha H. Ali 2011-04-20 20:02:33 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-When the tab key was pressed to display completion options for text, the cursor would move to an unexpected position on a line before the target line if the prompt contained characters not directly viewable followed by a "\]". This is now corrected to retain the cursor at the expected location at the end of the target line after autocomplete options correctly display.+When the tab key was pressed for auto-completion options for the typed text, the cursor moved to an unexpected position on a previous line if the prompt contained unviewable characters and a "\]". This is now fixed to retain the cursor at the expected position at the end of the target line after autocomplete options correctly display.
Comment 14 errata-xmlrpc 2011-07-21 06:37:14 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 therefore 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.

http://rhn.redhat.com/errata/RHSA-2011-1073.html

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