# HG changeset patch # User edogawaconan # Date 1394897910 -32400 # Node ID 84ad2517ac901346938ee41d9cb58dce017cd39b # Parent de5f65991cde781b6c00155faea81f9946966047 Refactor terminal-relatd detection in sunos. diff -r de5f65991cde -r 84ad2517ac90 rc/bashrc --- a/rc/bashrc Sun Mar 16 00:01:21 2014 +0900 +++ b/rc/bashrc Sun Mar 16 00:38:30 2014 +0900 @@ -87,6 +87,19 @@ _grep="grep" _has_posix_grep=y +if [ SunOS = "${_os}" ]; then + if [ -f /usr/share/lib/terminfo/s/screen ]; then + export TERMINFO=/usr/share/lib/terminfo + elif [ -f /opt/csw/share/terminfo/s/screen ]; then + export TERMINFO=/opt/csw/share/terminfo + else + unset TERMINFO + export TERM=dtterm + fi + + [ xterm = "${TERM}" ] && export TERM=xterm-256color +fi + case "${_os}" in Linux) _has_gnu_ls=y @@ -108,25 +121,6 @@ [ -d /opt/local/share/lib/terminfo ] && export TERMINFO=/opt/local/share/lib/terminfo alias ping="ping -s" alias ping6="ping -A inet6" - # 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"