# HG changeset patch # User Edho Arief # Date 1332062668 -25200 # Node ID b27e43878127bd4fdd72744ded60b3dfbd6e65fc # Parent 795ad57794a6e052bb9d25dd28712df8842dc570 [rc/bash] Better test for Solaris environment. diff -r 795ad57794a6 -r b27e43878127 rc/bash --- a/rc/bash Sun Mar 18 16:02:08 2012 +0700 +++ b/rc/bash Sun Mar 18 16:24:28 2012 +0700 @@ -61,12 +61,21 @@ # 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. - if [ -f /usr/share/lib/terminfo/x/xterm-256color ]; then - alias tmux="TERM=xterm-256color tmux" - else - echo "No xterm-256color terminal, using dtterm. Tmux title won't work." - fi - [ -f /usr/share/lib/terminfo/?/"${TERM}" ] || export TERM=dtterm + [ -f "/usr/share/lib/terminfo/x/xterm-256color" ] && has_xterm256c=y + [ -f "/usr/share/lib/terminfo/s/screen" ] && has_screen=y + 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 if command -v ggrep > /dev/null 2>&1; then _has_gnu_grep=y _grep="ggrep"