Bug 358231 - PS1='\[\017\]xyz' breaks the prompt
Summary: PS1='\[\017\]xyz' breaks the prompt
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tomas Janousek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On: 241647
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-10-30 14:29 UTC by Jan Kratochvil
Modified: 2008-01-11 22:04 UTC (History)
3 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2008-01-11 22:04:38 UTC


Attachments (Terms of Use)

Description Jan Kratochvil 2007-10-30 14:29:11 UTC
Description of problem:
My standard PS1 positions cursor incorrectly in the prompt.
It may be a readline specific bug.

Version-Release number of selected component (if applicable):
bash-3.2-18.fc8.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. PS1='\[\017\]xyz'
2. LC_CTYPE=en_US.UTF-8
  
Actual results:
Prompt cursor position is at the character 'z'.

Expected results:
Prompt cursor position is right behind the character 'z'.

Additional info:
\017 should set the standard character map to fixup terminal after a possible:
$ cat GARBAGE

Comment 1 Miroslav Lichvar 2007-11-02 13:10:58 UTC
This occurs only when the prompt has one invisible character and it's the first
character in the prompt. The following patch fixes the problem.

--- readline-5.2/display.c.inv
+++ readline-5.2/display.c
@@ -943,7 +943,7 @@ rl_redisplay ()
                  cpos_adjusted == 0 &&
                  _rl_last_c_pos != o_cpos &&
                  _rl_last_c_pos > wrap_offset &&
-                 o_cpos < prompt_last_invisible)
+                 o_cpos <= prompt_last_invisible)
                _rl_last_c_pos -= wrap_offset;

              /* If this is the line with the prompt, we might need to


Comment 2 Fedora Update System 2007-11-29 01:32:44 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 3 Fedora Update System 2007-11-29 01:37:06 UTC
bash-3.2-19.fc8 has been pushed to the Fedora 8 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 4 Fedora Update System 2008-01-11 22:04:30 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.

Comment 5 Fedora Update System 2008-01-11 22:04:55 UTC
bash-3.2-19.fc8 has been pushed to the Fedora 8 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.