comparison rc/bashrc @ 506:84ad2517ac90

Refactor terminal-relatd detection in sunos.
author edogawaconan <me@myconan.net>
date Sun, 16 Mar 2014 00:38:30 +0900
parents 072662ced8b8
children cd97af121309
comparison
equal deleted inserted replaced
505:de5f65991cde 506:84ad2517ac90
84 _has_gnu_ls= 84 _has_gnu_ls=
85 _has_gnu_grep= 85 _has_gnu_grep=
86 _ls="ls" 86 _ls="ls"
87 _grep="grep" 87 _grep="grep"
88 _has_posix_grep=y 88 _has_posix_grep=y
89
90 if [ SunOS = "${_os}" ]; then
91 if [ -f /usr/share/lib/terminfo/s/screen ]; then
92 export TERMINFO=/usr/share/lib/terminfo
93 elif [ -f /opt/csw/share/terminfo/s/screen ]; then
94 export TERMINFO=/opt/csw/share/terminfo
95 else
96 unset TERMINFO
97 export TERM=dtterm
98 fi
99
100 [ xterm = "${TERM}" ] && export TERM=xterm-256color
101 fi
89 102
90 case "${_os}" in 103 case "${_os}" in
91 Linux) 104 Linux)
92 _has_gnu_ls=y 105 _has_gnu_ls=y
93 _has_gnu_grep=y 106 _has_gnu_grep=y
106 [ -d "/opt/csw/gnu" ] && PATH="/opt/csw/gnu:${PATH}" 119 [ -d "/opt/csw/gnu" ] && PATH="/opt/csw/gnu:${PATH}"
107 # Working terminfo (as opposed to solaris' mostly-broken terminfo). 120 # Working terminfo (as opposed to solaris' mostly-broken terminfo).
108 [ -d /opt/local/share/lib/terminfo ] && export TERMINFO=/opt/local/share/lib/terminfo 121 [ -d /opt/local/share/lib/terminfo ] && export TERMINFO=/opt/local/share/lib/terminfo
109 alias ping="ping -s" 122 alias ping="ping -s"
110 alias ping6="ping -A inet6" 123 alias ping6="ping -A inet6"
111 # Check if we have sane(?) terminfo, assume broken terminfo otherwise.
112 if [ -z "${TERMINFO}" ]; then
113 # Hello tmux. Perhaps one day we'll have title with dtterm.
114 # But for now we work this around by prepending tmux call with xterm-256color
115 # which hopefully exists. Otherwise we have to live with no title.
116 case "${TERM}" in
117 xterm*)
118 if [ -f "/usr/share/lib/terminfo/x/xterm-256color" ]; then
119 export TERM="xterm-256color"
120 else
121 echo "No xterm-256color terminal, using dtterm. Tmux title won't work."
122 export TERM="dtterm"
123 fi
124 ;;
125 screen)
126 [ -f "/usr/share/lib/terminfo/s/screen" ] || export TERM="dtterm"
127 ;;
128 esac
129 fi
130 if command -v ggrep > /dev/null 2>&1; then 124 if command -v ggrep > /dev/null 2>&1; then
131 _has_gnu_grep=y 125 _has_gnu_grep=y
132 _grep="ggrep" 126 _grep="ggrep"
133 fi 127 fi
134 if command -v gls > /dev/null 2>&1; then 128 if command -v gls > /dev/null 2>&1; then