# HG changeset patch # User Edho Arief # Date 1355895343 0 # Node ID 9d016276d889765afcf0d03a675c9af85e8bab4e # Parent 6e682757a5f766fcd047681f65bac982af6c9dd4 Added compatibility with joyent's smartos. diff -r 6e682757a5f7 -r 9d016276d889 rc/bashrc --- a/rc/bashrc Tue Dec 11 23:36:20 2012 +0700 +++ b/rc/bashrc Wed Dec 19 05:35:43 2012 +0000 @@ -87,24 +87,31 @@ [ -d "${i}" ] && PATH="${PATH}:${i}" done [ -d "/opt/csw/gnu" ] && PATH="/opt/csw/gnu:${PATH}" + # Joyent's pkgsrc is awesome. + [ -d /opt/local ] && PATH="/opt/local/bin:/opt/local/sbin:${PATH}" + # Working terminfo (as opposed to solaris' mostly-broken terminfo). + [ -d /opt/local/share/lib/terminfo ] && export TERMINFO=/opt/local/share/lib/terminfo alias ping="ping -s" alias ping6="ping -A inet6" - # Hello tmux. Perhaps one day we'll have title with dtterm. - # But for now we work this around by prepending tmux call with xterm-256color - # which hopefully exists. Otherwise we have to live with no title. - case "${TERM}" in - xterm*) - if [ -f "/usr/share/lib/terminfo/x/xterm-256color" ]; then - export TERM="xterm-256color" - else - echo "No xterm-256color terminal, using dtterm. Tmux title won't work." - export TERM="dtterm" - fi - ;; - screen) - [ -f "/usr/share/lib/terminfo/s/screen" ] || export TERM="dtterm" - ;; - esac + # Check if we have sane(?) terminfo, assume broken terminfo otherwise. + if [ -z "${TERMINFO}" ]; then + # Hello tmux. Perhaps one day we'll have title with dtterm. + # But for now we work this around by prepending tmux call with xterm-256color + # which hopefully exists. Otherwise we have to live with no title. + case "${TERM}" in + xterm*) + if [ -f "/usr/share/lib/terminfo/x/xterm-256color" ]; then + export TERM="xterm-256color" + else + echo "No xterm-256color terminal, using dtterm. Tmux title won't work." + export TERM="dtterm" + fi + ;; + screen) + [ -f "/usr/share/lib/terminfo/s/screen" ] || export TERM="dtterm" + ;; + esac + fi if command -v ggrep > /dev/null 2>&1; then _has_gnu_grep=y _grep="ggrep"