From b97ffeabb84f70ad20a9d526e5fb1d6c7a89a50d Mon Sep 17 00:00:00 2001 From: Matt Foster Date: Tue, 7 Oct 2008 13:15:43 +0100 Subject: [PATCH] fixed a small problem with git-prompt --- 06_git | 1 + 10_prompt | 45 ++------------------------------------------- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/06_git b/06_git index 27720d6..42492fe 100644 --- a/06_git +++ b/06_git @@ -14,6 +14,7 @@ if [[ -x `which git` ]]; then git rebase master } function git-prompt() { + emulate -L zsh gstatus=$(git status 2> /dev/null) branch=$(echo $gstatus | head -n 1 | sed 's/^# On branch //') dirty=$(echo $gstatus | sed 's/^#.*$//' | tail -n 2 | grep 'nothing to commit (working directory clean)'; echo $?) diff --git a/10_prompt b/10_prompt index cca3982..66a4057 100644 --- a/10_prompt +++ b/10_prompt @@ -1,48 +1,7 @@ setopt prompt_subst # PROMPT='%{$reset_color%}%B%n%b@%m %~`git-prompt`%(!.#.>) ' -# Themable prompt of doom. -function prompt_doom_setup { - unset PS1 PS2 PS3 PS4 PROMPT RPROMPT - # Colours accepted as arguments - local u_col=${1:-'green'} - local h_col=${2:-'green'} - local d_col=${3:-'blue'} - local n_tru=${4:-'blue'} - local n_fal=${5:-'yellow'} - # looks like: ee1mpf@eepc-tsar16 ~ $ - ps1=( - "%{$fg_bold[$u_col]%}%n@" - "%{$fg_bold[$h_col]%}%m " - "%{$fg_bold[$d_col]%}%1~ " - "%{%(?.$fg_bold[$n_tru].$fg_bold[$n_fal])%}$" - " %{$reset_color%}" - ) - ps2=( - "%_ %{$fg_bold[$d_col]%}-> " - "%{$reset_color%}" - ) - PS2="${(j::)ps2}" - PS1="${(j::)ps1}" -} - -# print information when user runs 'prompt -h doom' -prompt_doom_help () { - cat <