summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2012-01-17 20:35:34 +0100
committerHugues Hiegel <hugues@hiegel.fr>2012-01-18 09:48:45 +0100
commit337f77d37f4651fdff324869f71c04225db92234 (patch)
treeaf685f7af37abdada8040072f20e02a4d7486fed
parentb7b42704a331475392c7ce262c1a3cf7951eb61b (diff)
Manages termcaps only on good terminals.. (CORRECTIONS)
-rw-r--r--01_Functions.zsh6
-rw-r--r--10_Environment.zsh22
2 files changed, 14 insertions, 14 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh
index 1431785..50d79c5 100644
--- a/01_Functions.zsh
+++ b/01_Functions.zsh
@@ -104,13 +104,13 @@ preprint()
do
hbar=${hbar}$_t_q
done
- hbar=${hbar}$_T[ae]
+ hbar=${hbar}$_T
if [ "$1" != "" ]
then
- print -Pn "${C_}$my_color;1${_C}${hbar}$_t_u${C_}0;$my_color${_C} $1 ${C_}0;$my_color;1${_C}$_t_t$_t_q\r${C_}0${_C}"
+ print -Pn "${C_}$my_color;1${_C}${hbar}$T_$_t_u$_T${C_}0;$my_color${_C} $1 ${C_}0;$my_color;1${_C}$T_$_t_t$_t_q$_T\r${C_}0${_C}"
else
- print -Pn "${C_}$my_color;1${_C}${hbar}$_t_q$_t_q$_t_q$_t_q$_t_q${C_}0${_C}"
+ print -Pn "${C_}$my_color;1${_C}${hbar}$T_$_t_q$_t_q$_t_q$_t_q$_t_q$_T${C_}0${_C}"
fi
}
diff --git a/10_Environment.zsh b/10_Environment.zsh
index 4d41f4a..49382f1 100644
--- a/10_Environment.zsh
+++ b/10_Environment.zsh
@@ -26,17 +26,17 @@ _c=m
C_="%{$c_"
_C="$_c%}"
-unset _t_
-[ $TERM = "urxvt" ] && _t_=yes
-T_=${_t_:+$termcap[as]}
-_T=${_t_:+$termcap[ae]}
-_t_q=${${_t_:+q}:--}
-_t_j=${${_t_:+j}:-[}
-_t_k=${${_t_:+k}:-[}
-_t_l=${${_t_:+l}:-]}
-_t_m=${${_t_:+m}:-]}
-_t_t=${${_t_:+t}:-]}
-_t_u=${${_t_:+u}:-]}
+unset has_termcaps
+[ $TERM = "urxvt" -o $TERM = "screen" ] && has_termcaps="true"
+T_=${has_termcaps:+$termcap[as]}
+_T=${has_termcaps:+$termcap[ae]}
+_t_q=${${has_termcaps:+q}:--}
+_t_j=${${has_termcaps:+j}:-[}
+_t_k=${${has_termcaps:+k}:-[}
+_t_l=${${has_termcaps:+l}:-]}
+_t_m=${${has_termcaps:+m}:-]}
+_t_t=${${has_termcaps:+t}:-]}
+_t_u=${${has_termcaps:+u}:-[}
# I hate kik00l0l colorized prompts, so I'm using a way to
# give a dominant color for each part of the prompt, each of