Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 572582 | Differences between
and this patch

Collapse All | Expand All

(-)bash/bashrc (-21 / +16 lines)
Lines 31-37 Link Here
31
# This does mean sessions get interleaved when reading later on, but this
31
# This does mean sessions get interleaved when reading later on, but this
32
# way the history is always up to date.  History is not synced across live
32
# way the history is always up to date.  History is not synced across live
33
# sessions though; that is what `history -n` does.
33
# sessions though; that is what `history -n` does.
34
PROMPT_COMMAND='history -a'
34
# Disabled by default due to concerns related to system recovery when $HOME
35
# is under duress, or lives somewhere flaky (like NFS).  Constantly syncing
36
# the history will halt the shell prompt until it's finished.
37
#PROMPT_COMMAND='history -a'
35
38
36
# Change the window title of X terminals 
39
# Change the window title of X terminals 
37
case ${TERM} in
40
case ${TERM} in
Lines 51-77 Link Here
51
# Set colorful PS1 only on colorful terminals.
54
# Set colorful PS1 only on colorful terminals.
52
# dircolors --print-database uses its own built-in database
55
# dircolors --print-database uses its own built-in database
53
# instead of using /etc/DIR_COLORS.  Try to use the external file
56
# instead of using /etc/DIR_COLORS.  Try to use the external file
54
# first to take advantage of user additions.  Use internal bash
57
# first to take advantage of user additions.
55
# globbing instead of external grep binary.
58
if type -P dircolors >/dev/null ; then
56
safe_term=${TERM//[^[:alnum:]]/?}   # sanitize TERM
59
	LS_COLORS=""
57
match_lhs=""
60
	if [[ -f ~/.dir_colors ]] ; then
58
[[ -f ~/.dir_colors   ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
61
		eval $(dircolors -b ~/.dir_colors)
59
[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
62
	elif [[ -f /etc/DIR_COLORS ]] ; then
60
[[ -z ${match_lhs}    ]] \
63
		eval $(dircolors -b /etc/DIR_COLORS)
61
	&& type -P dircolors >/dev/null \
64
	fi
62
	&& match_lhs=$(dircolors --print-database)
65
	[[ -n "$LS_COLORS" ]] && use_color=true
63
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
66
fi
67
64
68
65
if ${use_color} ; then
69
if ${use_color} ; then
66
	# Enable colors for ls, etc.  Prefer ~/.dir_colors #64489
67
	if type -P dircolors >/dev/null ; then
68
		if [[ -f ~/.dir_colors ]] ; then
69
			eval $(dircolors -b ~/.dir_colors)
70
		elif [[ -f /etc/DIR_COLORS ]] ; then
71
			eval $(dircolors -b /etc/DIR_COLORS)
72
		fi
73
	fi
74
75
	if [[ ${EUID} == 0 ]] ; then
70
	if [[ ${EUID} == 0 ]] ; then
76
		PS1+='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
71
		PS1+='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
77
	else
72
	else
Lines 96-102 Link Here
96
done
91
done
97
92
98
# Try to keep environment pollution down, EPA loves us.
93
# Try to keep environment pollution down, EPA loves us.
99
unset use_color safe_term match_lhs sh
94
unset use_color sh
100
95
101
# Own additions:
96
# Own additions:
102
97

Return to bug 572582