chiark / gitweb /
dot/bashrc: Portability: use termcap if terminfo doesn't work.
[profile] / dot / bashrc
index c26fad38cab93136c1157eb265d67347a4269373..f6b7a56e0015135c8781772182f88e6da04a3336 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