Debian Bug report logs - #352234
bash: PS1 with escape sequences suddenly broken

version graph

Package: bash; Maintainer for bash is Matthias Klose <doko@debian.org>; Source for bash is src:bash.

Reported by: Hans Fugal <hans@fugal.net>

Date: Fri, 10 Feb 2006 15:48:31 UTC

Severity: normal

Found in versions bash/3.1-2, bash/2.05b-26

Fixed in version bash/3.2-2

Done: Matthias Klose <doko@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#352234; Package bash. Full text and rfc822 format available.

Acknowledgement sent to Hans Fugal <hans@fugal.net>:
New Bug report received and forwarded. Copy sent to Matthias Klose <doko@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Hans Fugal <hans@fugal.net>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: bash: PS1 with escape sequences suddenly broken
Date: Thu, 09 Feb 2006 07:25:05 -0700
Package: bash
Version: 3.1-2
Severity: normal


I just upgraded to this version of bash (I'm sorry I don't know what I
was running before - whatever was in testing a couple of months ago) and
now my PS1 is broken.

My PS1 looks like this:

    PS1='$(r=$?; [ 0 == $r ] || echo "\[\033[33m\]$r\[\033[0m\] ")\u@\h:\w\[\033[32m\]\$\[\033[0m\] '

Which looks like this, without the color:

    fugalh@falcon:~$ 
                     ^

The caret indicates where the cursor lies. Now, after upgrading, the
prompt looks the same but the caret has moved 

    fugalh@falcon:~$ 
            ^

or

    1 fugalh@falcon:~$ 
     ^

If I remove the escape sequences (which give a little color), it behaves
normally. If I leave the escape sequences but remove the \[\] pairs, the
cursor goes in the right place (but wouldn't that break line wrapping?).

It doesn't matter what terminal emulator I am using (or indeed whether I
ssh in).

Downgrading to version 2.05b-26 restores correct behavior.
    
-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (50, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages bash depends on:
ii  base-files                    3.1.9      Debian base system miscellaneous f
ii  debianutils                   2.15.2     Miscellaneous utilities specific t
ii  libc6                         2.3.5-8    GNU C Library: Shared libraries an
ii  libncurses5                   5.5-1      Shared libraries for terminal hand

bash recommends no packages.

-- debconf-show failed



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#352234; Package bash. Full text and rfc822 format available.

Acknowledgement sent to Justin Pryzby <justinpryzby@users.sourceforge.net>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. Full text and rfc822 format available.

Message #10 received at 352234@bugs.debian.org (full text, mbox):

From: Justin Pryzby <justinpryzby@users.sourceforge.net>
To: Hans Fugal <hans@fugal.net>, 352234@bugs.debian.org
Subject: Re: Bug#352234: bash: PS1 with escape sequences suddenly broken
Date: Fri, 10 Feb 2006 10:53:14 -0500
On Thu, Feb 09, 2006 at 07:25:05AM -0700, Hans Fugal wrote:
> Package: bash
> Version: 3.1-2
> Severity: normal
> 
> 
> I just upgraded to this version of bash (I'm sorry I don't know what I
> was running before - whatever was in testing a couple of months ago) and
You might have a /var/log/dpkg.log which is written by default in new
versions of dpkg.

Justin



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#352234; Package bash. Full text and rfc822 format available.

Acknowledgement sent to Hans Fugal <hans@fugal.net>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. Full text and rfc822 format available.

Message #15 received at 352234@bugs.debian.org (full text, mbox):

From: Hans Fugal <hans@fugal.net>
To: 352234@bugs.debian.org
Subject: Re: Bug#352234: bash: PS1 with escape sequences suddenly broken
Date: Fri, 10 Feb 2006 10:25:25 -0700
[Message part 1 (text/plain, inline)]
Ok, if I'm reading this right I upgraded from version 3.0-16

2006-02-09 00:12:28 upgrade bash 3.0-16 3.1-2

On Fri, 10 Feb 2006 at 10:53 -0500, Justin Pryzby wrote:
> On Thu, Feb 09, 2006 at 07:25:05AM -0700, Hans Fugal wrote:
> > Package: bash
> > Version: 3.1-2
> > Severity: normal
> > 
> > 
> > I just upgraded to this version of bash (I'm sorry I don't know what I
> > was running before - whatever was in testing a couple of months ago) and
> You might have a /var/log/dpkg.log which is written by default in new
> versions of dpkg.
> 
> Justin
> 

-- 
Hans Fugal ; http://hans.fugal.net
 
There's nothing remarkable about it. All one has to do is hit the 
right keys at the right time and the instrument plays itself.
    -- Johann Sebastian Bach
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#352234; Package bash. Full text and rfc822 format available.

Acknowledgement sent to Kai Henningsen <kai@colo.khms.westfalen.de>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. Full text and rfc822 format available.

Message #20 received at 352234@bugs.debian.org (full text, mbox):

From: Kai Henningsen <kai@colo.khms.westfalen.de>
To: Debian Bug Tracking System <352234@bugs.debian.org>
Subject: More on prompt breakage
Date: Wed, 17 May 2006 18:17:26 +0200
Package: bash
Version: 2.05b-26
Followup-For: Bug #352234

Here's an extract from my /etc/profile:
-- snip --
# prompt
clr=$( grep "$(/usr/bin/tty) " /etc/promptcolor | cut -d" " -f2 )
color="\\e[${clr}m"

reset="\\e[0m"

marker1='${debian_chroot:+($debian_chroot)}'
marker2="\$USER=\\u \\h $(basename $(/usr/bin/tty)) \\w"
marker3="$marker1\\[$reset$color\\]$marker2 \\[$reset\\]\\n\\$ "
marker3=" $marker1\\[$reset$color\\]$marker2 \\[$reset\\]\\n\\$ "
case "$TERM" in
	screen*)        :
		PS1='\[\033k'"$marker1 $marker2"'\033\\'"$marker3"
	;;
	xterm*|rxvt*)         :
		PS1='\[\033]0;'"$marker1 $marker2"'\007'"$marker3"
	;;
	*)		:
		PS1="$marker3"
	;;
esac
export PATH PS1 color
-- snip --

Originally, it only had the first of the two marker3 lines. That worked
fine when ssh'ing in with TERM=xterm, but recently broke horribly with
TERM=screen. The second line *does* work with TERM=screen - it really is
the single space character that makes the difference.

Presumably bash gets confused at that position.

Hope this helps finding the bug.

(Symptoms of the breakage: no visible prompt, pressing enter several
times spews *parts* of the *raw* value of PS1 (some parts of marker1).
Something is wrong with the terminal itself: after exiting, the prompt
on the other side is damaged - missing characters - until I run 'reset'.)

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.13.2+colo.20051014
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages bash depends on:
ii  base-files              3.1.2            Debian base system miscellaneous f
ii  libc6                   2.3.6-7          GNU C Library: Shared libraries
ii  libncurses5             5.5-2            Shared libraries for terminal hand
ii  passwd                  1:4.0.3-31sarge5 change and administer password and

-- no debconf information



Reply sent to Matthias Klose <doko@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Hans Fugal <hans@fugal.net>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #25 received at 352234-close@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@debian.org>
To: 352234-close@bugs.debian.org
Subject: Bug#352234: fixed in bash 3.2-2
Date: Sun, 20 Apr 2008 10:02:03 +0000
Source: bash
Source-Version: 3.2-2

We believe that the bug you reported is fixed in the latest version of
bash, which is due to be installed in the Debian FTP archive:

bash-builtins_3.2-2_amd64.deb
  to pool/main/b/bash/bash-builtins_3.2-2_amd64.deb
bash-doc_3.2-2_all.deb
  to pool/main/b/bash/bash-doc_3.2-2_all.deb
bash-minimal_3.2-2_amd64.deb
  to pool/main/b/bash/bash-minimal_3.2-2_amd64.deb
bash-static_3.2-2_amd64.deb
  to pool/main/b/bash/bash-static_3.2-2_amd64.deb
bash_3.2-2.diff.gz
  to pool/main/b/bash/bash_3.2-2.diff.gz
bash_3.2-2.dsc
  to pool/main/b/bash/bash_3.2-2.dsc
bash_3.2-2_amd64.deb
  to pool/main/b/bash/bash_3.2-2_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 352234@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <doko@debian.org> (supplier of updated bash package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sun, 20 Apr 2008 11:20:08 +0200
Source: bash
Binary: bash bash-minimal bash-static bash-builtins bash-doc bashdb
Architecture: source all amd64
Version: 3.2-2
Distribution: unstable
Urgency: low
Maintainer: Matthias Klose <doko@debian.org>
Changed-By: Matthias Klose <doko@debian.org>
Description: 
 bash       - The GNU Bourne Again SHell
 bash-builtins - Bash loadable builtins - headers & examples
 bash-doc   - Documentation and examples for the The GNU Bourne Again SHell
 bash-minimal - The GNU Bourne Again SHell (minimal version)
 bash-static - The GNU Bourne Again SHell (static version)
 bashdb     - The GNU Bourne Again SHell Debugger
Closes: 314533 342225 352234 362010 364861 374452 378067 382892 383762 390493 397086 414285 418961 420656 420659 420661 423488 426687 431620 440102 442477 449587 452459 452656 470453 471490 473870
Changes: 
 bash (3.2-2) unstable; urgency=low
 .
   * Add a shopt option compat31 to fall back to the behaviour of bash-3.1
     and earlier versions, in that quoting the string argument to the [[
     command's =~ +operator does not force string matching.
 .
   * Merge from Ubuntu:
     - Remove /etc/skel/.bash_profile, if it is unmodified; if modified and
       /etc/skel/.profile is unmodifed, move .bash_profile to .profile.
     - /etc/skel/.bashrc: Add an option to blurt a terminal window with a
       colored prompt.
     - /etc/skel/.bashrc: Add color support for grep and friends (commented
       out by default). Closes: #420659.
     - /etc/skel/.profile: Avoid the use of `~'.
     - Don't run command-not-found from the shell scripts when it has been
       removed in the meantime.
   * /etc/skel/.bashrc:
     - Comment out the lesspipe settings. Closes: #470453.
     - Don't use PROMPT_COMMAND to set the title of an xterm. Closes: #420656.
     - Don't second-guess terminal handling in dircolors. Closes: #473870.
     - Don't overwrite GNU Midnight Commander's setting of HISTCONTROL to
       `ignorespace'. Closes: #440102.
     - Add a comment about setting HISTSIZE and HISTFILESIZE. Closes: #449587.
     - Append to the history file, don't overwrite it. Closes: #452459.
     - Use dir and vdir commands for dir vdir aliases. Closes: #420661.
   * /etc/skel/.profile:
     - Add comment about setting the umask for ssh logins. Closes: #314533.
 .
   * Added code to defer the initialization of HISTSIZE until the history file
     is loaded. Closes: #383762.
   * Fix typos in README.Debian and preinst. Closes: #374452.
   * Mention `exec' builtin in the section `redirection'. Closes: #378067.
   * Add bashbug(1). Closes: #442477.
   * Fix typos in bash(1). Closes: #390493, #426687.
   * Fix bug in Bash_aliases example. Closes: #423488.
   * Fix typo in help message for caller builtin. Closes: #452656.
 .
 bash (3.2-1) experimental; urgency=low
 .
   * New upstream version (including upstream patches 01 - 33). Closes: #431620.
     - Added write error reporting to printf builtin. Closes: #414285.
     - Fixed a bug that caused `unset LANG' to not properly reset the locale.
       Closes: #364861.
     - Describe expansion of pattern in case statement. Closes: #342225.
     - Improved handling of non-printable characters in prompt. Closes: #352234,
       #362010, #397086, #418961, #471490.
     - Fix typos in documentation. Closes: #382892.
 .
     The syntax of regexes in Bash 3.2 was changed so that single quotes no
     longer surround regexes. e.g, a regex of the form
       if [[ "foo.tex" =~ '^(.*)\.tex$' ]]
     becomes
       if [[ "foo.tex" =~ ^(.*)\.tex$ ]]
 .
   * Merge from Ubuntu:
     - debian/skel.bashrc: Check for dircolors before using it.
     - debian/skel.bashrc: Set HISTCONTROL to ignoreboth.
     - Include correct bash.pot file.
     - Move CWRU/changelog from the bash to the bash-doc package (we already
       have the CHANGES files).
     - debian/etc.bash.bashrc: Install command-not-found handler if available.
Checksums-Sha1: 
 0988220a8acd1fd5e5eeb67f09c17c013147e90c 1108 bash_3.2-2.dsc
 041eee1fd332c5033f0dea5add22ca885ba10d2f 150775 bash_3.2-2.diff.gz
 81601379e6458e173194de93dea84bb81d1a78ad 316822 bash-doc_3.2-2_all.deb
 2e71f4bdf67895264a22dff11e5d6a37324f3628 632366 bash_3.2-2_amd64.deb
 97cf5e575c9cf34c7186f6213f36ce878affc8e5 100272 bash-builtins_3.2-2_amd64.deb
 c2e68cf38a3d28f49e47031e8746a2b2c9be1c27 760352 bash-static_3.2-2_amd64.deb
 59506b11f4e5071a3a62f1929edd0ff7d1083aec 227690 bash-minimal_3.2-2_amd64.deb
Checksums-Sha256: 
 174d2cf0f099dbcb4e0cd6613d7e20d14f05518cc3c835e83652988044562aa3 1108 bash_3.2-2.dsc
 ecc03b363e85165b2e0dcf800aa9ce070a73c5757d81e97d30003b59e2cdb235 150775 bash_3.2-2.diff.gz
 359a2cabbf608566fc8a58a45a0aceb327b9266e45e0feb492e16264f50e8cd0 316822 bash-doc_3.2-2_all.deb
 72ca32cf3142fdb474d96cc85a182feacfed2cb047912e802aaa1ebd01fbd02d 632366 bash_3.2-2_amd64.deb
 edc63f26da022b9d8e42f9d429970f4ed09c1ec76831d19d424952c60eea3870 100272 bash-builtins_3.2-2_amd64.deb
 42a0b18bdd5fff36814297377699fb5bf4cecaa9608d99660f5b128b07c60559 760352 bash-static_3.2-2_amd64.deb
 7561d514dcc972b1f64ae1b841121015df153f3af6846a8157c30ed7a99637f0 227690 bash-minimal_3.2-2_amd64.deb
Files: 
 95abb9fe0e6c6fc342bde65c248ef883 1108 base required bash_3.2-2.dsc
 a7293dbbfe38a331f96cce924a8ba3c2 150775 base required bash_3.2-2.diff.gz
 9ba105be663a296eca3b2931450b689b 316822 doc optional bash-doc_3.2-2_all.deb
 93ae2cbf7aadc475412f2194757ddfdb 632366 shells required bash_3.2-2_amd64.deb
 00ce90a84ee6bdd5ae5b293e528f206a 100272 utils optional bash-builtins_3.2-2_amd64.deb
 e7d5b254478024d6dbde5434ed88b0ec 760352 shells optional bash-static_3.2-2_amd64.deb
 7b0f5d201bc0156b61c26e5f3ee9e7fc 227690 shells optional bash-minimal_3.2-2_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFICxAoStlRaw+TLJwRArWJAJ90EYq/C7Hn7ENWsCxZdb8lCiT+lQCfXLYb
1+fJcMg2yni8DUJGzk97uqA=
=u0iA
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 15 Jul 2008 07:29:37 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 11:19:19 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.