dot/bashrc: Portability: use termcap if terminfo doesn't work.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 25 Jun 2011 13:40:05 +0000 (14:40 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 30 Nov 2011 19:18:58 +0000 (19:18 +0000)
Grumble grumble FreeBSD grumble.

dot/bashrc

index c26fad3..f6b7a56 100644 (file)
@@ -26,7 +26,12 @@ if [ -t 0 ]; then
   ## Fancy highlighting in some terminals.
   case "$TERM" in
     linux*|screen*|xterm*|vt100*|eterm*)
-      bold="\[$(tput bold)\]" unbold="\[$(tput sgr0)\]" nl="\[\r\]" ;;
+      case "$(tput bold)" in
+       "") bold="\[$(tput md)\]" unbold="\[$(tput me)\]" ;;
+       *) bold="\[$(tput bold)\]" unbold="\[$(tput sgr0)\]" ;;
+      esac
+      nl="\[\r\]"
+      ;;
     *)
       bold='' unbold='' nl='' ;;
   esac