PS1: wrong display of accentuate character with \w

Bug #1247854 reported by Id2ndR
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

An UTF-8 character after an Ascii character is misinterpreted. It's difficult to explain the trouble so I get some commands to actually see it. Feel free to improve my description.

This test case work on gnome-terminal and xterm only when it is sized with 80 characters long.

$ echo $PS1 # Default value
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$
$ temp_dirname1=/tmp/$(perl -e 'print "a" x '$(echo "80-(${#USER}+${#HOSTNAME}+4)-4" | bc)',"à","a" x 4,"\n"')
$ temp_dirname2=/tmp/$(perl -e 'print "a" x '$(echo "80-(${#USER}+${#HOSTNAME}+4)-4" | bc)',"a","a" x 4,"\n"')
$ temp_dirname3=/tmp/$(perl -e 'print "a" x '$(echo "80-(${#USER}+${#HOSTNAME}+4)-5" | bc)',"àà","a" x 4,"\n"')
$ echo -e $temp_dirname1"\n"$temp_dirname2"\n"$temp_dirname3 # Look at the actual values for these three variables
$ mkdir $temp_dirname1 $temp_dirname2 $temp_dirname3
$ cd $temp_dirname1 # Wrong display
$ cd $temp_dirname2 # Correct display
$ cd $temp_dirname3 # Neither completely correct display neither wrong display (there is one space left at the end of the line that doesn't exist)

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: bash 4.2-5ubuntu3
ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
Uname: Linux 3.11.0-12-generic i686
ApportVersion: 2.12.5-0ubuntu2.1
Architecture: i386
Date: Mon Nov 4 15:04:59 2013
InstallationDate: Installed on 2013-04-22 (195 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release i386 (20130420)
MarkForUpload: True
SourcePackage: bash
UpgradeStatus: Upgraded to saucy on 2013-09-06 (59 days ago)

Revision history for this message
Id2ndR (id2ndr) wrote :
Revision history for this message
Aymeric (mulx) wrote :

I confirm this bug, using lxterminal on Ubuntu Precise.
I've added a screenshoot of the second example to make it more obvious.

Changed in bash (Ubuntu):
status: New → Confirmed
tags: added: precise
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.