46d13384db11634257aa803fc1e05f1ac6e10a1b
Author Hongxin Liang <hxliang1982@gmail.com> Committer Hongxin Liang <hxliang1982@gmail.com> Date 2015-07-13 16:43 UTC
Message [theme] Fix color problem of steeef theme
steeef theme sets colors depending on $TERM, however if %F is
used, it must be closed by %f instead of %{$reset_color%}.
Further on, all %f directives have been replaced by %F and color
support of current TERM is checked more properly.
Diff 1 diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme
2 index 13728ca9a9b95fe7bcef160ef5e01f1d2ec3a3b0..13dc3ad2f263c8c51016a8e8de5caf9976ccebf9 100644
3 --- a/themes/steeef.zsh-theme
4 +++ b/themes/steeef.zsh-theme
5 @@ -10,7 +10,7 @@
6 export VIRTUAL_ENV_DISABLE_PROMPT=1
7
8 function virtualenv_info {
9 - [ $VIRTUAL_ENV ] && echo '('$fg[blue]`basename $VIRTUAL_ENV`%{$reset_color%}') '
10 + [ $VIRTUAL_ENV ] && echo '('%F{blue}`basename $VIRTUAL_ENV`%f') '
11 }
12 PR_GIT_UPDATE=1
13
14 @@ -20,18 +20,18 @@ autoload -U add-zsh-hook
15 autoload -Uz vcs_info
16
17 #use extended color pallete if available
18 -if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
19 +if [[ $terminfo[colors] -ge 256 ]]; then
20 turquoise="%F{81}"
21 orange="%F{166}"
22 purple="%F{135}"
23 hotpink="%F{161}"
24 limegreen="%F{118}"
25 else
26 - turquoise="$fg[cyan]"
27 - orange="$fg[yellow]"
28 - purple="$fg[magenta]"
29 - hotpink="$fg[red]"
30 - limegreen="$fg[green]"
31 + turquoise="%F{cyan}"
32 + orange="%F{yellow}"
33 + purple="%F{magenta}"
34 + hotpink="%F{red}"
35 + limegreen="%F{green}"
36 fi
37
38 # enable VCS systems you use
39 @@ -48,7 +48,7 @@ zstyle ':vcs_info:*:prompt:*' check-for-changes true
40 # %a - action (e.g. rebase-i)
41 # %R - repository path
42 # %S - path in the repository
43 -PR_RST="%{${reset_color}%}"
44 +PR_RST="%f"
45 FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"
46 FMT_ACTION="(%{$limegreen%}%a${PR_RST})"
47 FMT_UNSTAGED="%{$orange%}●"
48 @@ -96,5 +96,5 @@ function steeef_precmd {
49 add-zsh-hook precmd steeef_precmd
50
51 PROMPT=$'
52 -%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_$(virtualenv_info)%{$reset_color%}
53 +%{$purple%}%n${PR_RST} at %{$orange%}%m${PR_RST} in %{$limegreen%}%~${PR_RST} $vcs_info_msg_0_$(virtualenv_info)
54 $ '