From 6d1cfd8f1d94e3a2936cadb81e2aa1093b3a54f0 Mon Sep 17 00:00:00 2001 From: Joris Dedieu Date: Fri, 20 Jul 2012 14:10:13 +0200 Subject: [PATCH] Change tput calls to use termcap instead of terminfo. Because it's unsupport on some systems like FreeBSD. Changes make color working on both FreeBSD and Linux --- liquidprompt.bash | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/liquidprompt.bash b/liquidprompt.bash index febfe5b..0103ff9 100755 --- a/liquidprompt.bash +++ b/liquidprompt.bash @@ -45,33 +45,33 @@ fi unset bash bmajor bminor -BLACK="\[$(tput setaf 0)\]" +BLACK="\[$(tput AF 0)\]" -GRAY="\[$(tput bold ; tput setaf 0)\]" -LIGHT_GREY="\[$(tput setaf 7)\]" -WHITE="\[$(tput bold ; tput setaf 7)\]" +GRAY="\[$(tput md ; tput AF 0)\]" +LIGHT_GREY="\[$(tput AF 7)\]" +WHITE="\[$(tput md ; tput AF 7)\]" -RED="\[$(tput setaf 1)\]" -LIGHT_RED="\[$(tput bold ; tput setaf 1)\]" -WARN_RED="\[$(tput setaf 0 ; tput setab 1)\]" -CRIT_RED="\[$(tput bold; tput setaf 7 ; tput setab 1)\]" +RED="\[$(tput AF 1)\]" +LIGHT_RED="\[$(tput md ; tput AF 1)\]" +WARN_RED="\[$(tput AF 0 ; tput setab 1)\]" +CRIT_RED="\[$(tput md; tput AF 7 ; tput setab 1)\]" -GREEN="\[$(tput setaf 2)\]" -LIGHT_GREEN="\[$(tput bold ; tput setaf 2)\]" +GREEN="\[$(tput AF 2)\]" +LIGHT_GREEN="\[$(tput md ; tput AF 2)\]" -YELLOW="\[$(tput setaf 3)\]" -LIGHT_YELLOW="\[$(tput bold ; tput setaf 3)\]" +YELLOW="\[$(tput AF 3)\]" +LIGHT_YELLOW="\[$(tput md ; tput AF 3)\]" -BLUE="\[$(tput setaf 4)\]" -LIGHT_BLUE="\[$(tput bold ; tput setaf 4)\]" +BLUE="\[$(tput AF 4)\]" +LIGHT_BLUE="\[$(tput md ; tput AF 4)\]" -PURPLE="\[$(tput setaf 5)\]" -PINK="\[$(tput bold ; tput setaf 5)\]" +PURPLE="\[$(tput AF 5)\]" +PINK="\[$(tput md ; tput AF 5)\]" -CYAN="\[$(tput setaf 6)\]" -LIGHT_CYAN="\[$(tput bold ; tput setaf 6)\]" +CYAN="\[$(tput AF 6)\]" +LIGHT_CYAN="\[$(tput md ; tput AF 6)\]" -NO_COL="\[$(tput sgr0)\]" +NO_COL="\[$(tput me)\]" case $(uname) in "Linux" ) OS="Linux" ;;