Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 177687

Summary: app-shells/bash - default bashrc causes issues with multiline commands
Product: Gentoo Linux Reporter: Leonardo Valeri Manera <l.valerimanera>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED NEEDINFO    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Leonardo Valeri Manera 2007-05-08 18:27:43 UTC
see: http://forums.gentoo.org/viewtopic-t-556878.html

escape characters in the default /etc/profile /etc/bash/bashrc PS1 vars aren't contained in \[, \] pairs as per bash spec, leading to strange issues with editing multiline commands, as bash gets confused about spacing, calculating space for characters that do not appear on screen (the colour settings)

Reproducible: Always

Steps to Reproduce:
1.type a command that takes up 2 lines or more
2.try to edit
3.experience.. the twilight zone!

Actual Results:  
you have to sort of guess where the chars actually are by going over the parts you want to change with the cursor.

Expected Results:  
normal command editing
Comment 1 Leonardo Valeri Manera 2007-05-08 18:28:51 UTC
btw, this is with bash-3.2_p15-r1
Comment 2 SpanKY gentoo-dev 2007-05-08 18:56:24 UTC
PS1 in /etc/profile does not use escape sequences

PS1 in the default /etc/bash/bashrc is quoted just fine:
files/bashrc:  PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
files/bashrc:  PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '