Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 141771 - /etc/bash/bashrc does not set $use_color to true for TERMs with non alpha/numeric in $TERM
Summary: /etc/bash/bashrc does not set $use_color to true for TERMs with non alpha/num...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 141820 141821 166733 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-26 02:50 UTC by ash
Modified: 2007-02-13 23:58 UTC (History)
3 users (show)

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 ash 2006-07-26 02:50:46 UTC
Because of $TERM sanitization:

safe_term=${TERM//[^[:alnum:]]/.}   # sanitize TERM

all terms with a dash in their name (rxvt-unicode, xterm-color, etc.) are not matched:

[[ $'\n'${match_lhs} == *$'\n'"TERM ${safe_term}"* ]] && use_color=true

I propose the following match to be used:

[[ $'\n'${match_lhs} =~ $'\n'"TERM ${safe_term}" ]] && use_color=true

Another (probably better) way to fix the bug is to use less aggressive sanitization:

safe_term=${TERM//[^[:alnum:]_-]/.}
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-07-26 13:07:18 UTC
*** Bug 141820 has been marked as a duplicate of this bug. ***
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-07-26 17:35:26 UTC
*** Bug 141821 has been marked as a duplicate of this bug. ***
Comment 3 SpanKY gentoo-dev 2006-07-31 22:23:50 UTC
fixed in cvs
Comment 4 SpanKY gentoo-dev 2007-02-13 23:58:25 UTC
*** Bug 166733 has been marked as a duplicate of this bug. ***