Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 354719 - app-shells/bash-4.1_p9: bug & fix for PROMPT_COMMAND in /etc/bash/bashrc
Summary: app-shells/bash-4.1_p9: bug & fix for PROMPT_COMMAND in /etc/bash/bashrc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-13 11:48 UTC by Evert
Modified: 2011-02-19 18:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evert 2011-02-13 11:48:55 UTC
Currently, /etc/bash/bashrc contains:
  PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'

Now Let's:

mkdir -p "/tmp/$HOME"
cd "/tmp/$HOME"

and look at the title bar.
I see "user@host:/tmp~" which is wrong.

Easy fix: replace ${PWD/$HOME/~} by ${PWD/#$HOME/~}

see man bash:
  ${parameter/pattern/string}
    If pattern begins with #, it must match at the
    beginning of the expanded value of parameter.

Reproducible: Always

Steps to Reproduce:
1. mkdir -p "/tmp/$HOME"
2. cd "/tmp/$HOME"
3. look at the title bar

Actual Results:  
title bar shows: user@host:/tmp~

Expected Results:  
title bar should show: user@host:/tmp/home/user

emerge --info is not needed here I guess ;-)
Comment 1 SpanKY gentoo-dev 2011-02-19 18:51:16 UTC
thanks ... added to cvs

http://sources.gentoo.org/app-shells/bash/files/bashrc?r1=1.19&r2=1.20