summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-01-04 23:44:41 +0000
committerMike Frysinger <vapier@gentoo.org>2007-01-04 23:44:41 +0000
commit775a6a85888f1da4a9902e75a95dce00279b8cd8 (patch)
tree51bb46b721a0529f3e799a01c7481051f2d78c72 /app-shells
parentBug 160127, keywording ~amd64 (diff)
downloadgentoo-2-775a6a85888f1da4a9902e75a95dce00279b8cd8.tar.gz
gentoo-2-775a6a85888f1da4a9902e75a95dce00279b8cd8.tar.bz2
gentoo-2-775a6a85888f1da4a9902e75a95dce00279b8cd8.zip
Add more support for BSD systems.
(Portage version: 2.1.2_rc4-r5)
Diffstat (limited to 'app-shells')
-rw-r--r--app-shells/bash/ChangeLog5
-rw-r--r--app-shells/bash/files/bashrc41
2 files changed, 29 insertions, 17 deletions
diff --git a/app-shells/bash/ChangeLog b/app-shells/bash/ChangeLog
index f8546ea9d58c..512d90911732 100644
--- a/app-shells/bash/ChangeLog
+++ b/app-shells/bash/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for app-shells/bash
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.129 2007/01/01 19:23:15 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.130 2007/01/04 23:44:41 vapier Exp $
+
+ 04 Jan 2007; Mike Frysinger <vapier@gentoo.org> files/bashrc:
+ Add more support for BSD systems.
01 Jan 2007; Roy Marples <uberlord@gentoo.org>
files/bash-3.2-dev-fd-test-as-user.patch:
diff --git a/app-shells/bash/files/bashrc b/app-shells/bash/files/bashrc
index b6fee4df9e22..be1bec629c88 100644
--- a/app-shells/bash/files/bashrc
+++ b/app-shells/bash/files/bashrc
@@ -23,6 +23,21 @@ shopt -s checkwinsize
# Enable history appending instead of overwriting. #139609
shopt -s histappend
+# Change the window title of X terminals
+case ${TERM} in
+ xterm*|rxvt*|Eterm|aterm|kterm|gnome)
+ PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
+ ;;
+ screen)
+ PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
+ ;;
+esac
+#BSD#@# BSD doesn't typically come with dircolors so we need
+#BSD#@# to be lame and hardcode some terminals in here.
+#BSD#@case ${TERM} in
+#BSD#@ xterm*|rxvt*|Eterm|aterm|kterm|gnome|screen|cons25) use_color=true;;
+#BSD#@esac
+
# Set colorful PS1 only on colorful terminals.
# dircolors --print-database uses its own built-in database
# instead of using /etc/DIR_COLORS. Try to use the external file
@@ -33,16 +48,20 @@ safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
match_lhs=""
[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
-[[ -z ${match_lhs} ]] && match_lhs=$(dircolors --print-database)
+[[ -z ${match_lhs} ]] \
+ && type -p dircolors >/dev/null #BSD#@ \
+ && match_lhs=$(dircolors --print-database)
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
if ${use_color} ; then
# Enable colors for ls, etc. Prefer ~/.dir_colors #64489
- if [[ -f ~/.dir_colors ]] ; then
- eval $(dircolors -b ~/.dir_colors)
- elif [[ -f /etc/DIR_COLORS ]] ; then
- eval $(dircolors -b /etc/DIR_COLORS)
- fi
+ if type -p dircolors >/dev/null ; then#BSD#@
+ if [[ -f ~/.dir_colors ]] ; then
+ eval $(dircolors -b ~/.dir_colors)
+ elif [[ -f /etc/DIR_COLORS ]] ; then
+ eval $(dircolors -b /etc/DIR_COLORS)
+ fi
+ fi#BSD#@
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
@@ -64,13 +83,3 @@ fi
# Try to keep environment pollution down, EPA loves us.
unset use_color safe_term match_lhs
-
-# Change the window title of X terminals
-case ${TERM} in
- xterm*|rxvt*|Eterm|aterm|kterm|gnome)
- PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
- ;;
- screen)
- PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
- ;;
-esac