From 5d6dca3f97bbc6393cc62ca696eec98022de6324 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Tue, 1 Apr 2008 16:05:41 +0200 Subject: nouvelle colorization des branches GIT.. --- 01_Functions.zsh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index 3d1221d..af6423c 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -83,14 +83,25 @@ get_git_branch () # a call to `get_git_branch` get_git_status () { - local my_git_status + local my_git_status cached not_up_to_date managment_folder - if [ "$(git-rev-parse --git-dir)" == "." ] - then - my_git_status="$git_colors[managment_folder]" - elif [ "$(git-diff --cached 2>&- | grep '^diff ')" != "" ] ; then + if [ "$(git-rev-parse --git-dir)" == "." ] ; then + echo "$git_colors[managment_folder]" + return + fi + + if [ "$(git-diff --cached 2>&- | grep '^diff ')" != "" ] ; then + cached="yes" + fi + if [ "$(git-ls-files -m 2>&-)" != "" ] ; then + not_up_to_date="yes" + fi + + if [ "$cached" != "" -a "$not_up_to_date" != "" ] ; then + my_git_status="$git_colors[cached_and_not_up_to_date]" + elif [ "$cached" != "" ] ; then my_git_status="$git_colors[cached]" - elif [ "$(git-ls-files -m 2>&-)" != "" ] ; then + elif [ "$not_up_to_date" != "" ] ; then my_git_status="$git_colors[not_up_to_date]" else my_git_status="$git_colors[up_to_date]" -- cgit v1.2.3 From bb76357c72d67b5eab803fccce27617d178f7ed3 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 22 May 2008 17:06:44 +0200 Subject: Personnalized non-UTF8 title for PuTTY terms. Don't forget to set "TERM" to "putty" when needed... --- 01_Functions.zsh | 2 +- 12_Prompts.zsh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index af6423c..d4c77bf 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -29,7 +29,7 @@ term_title() sun-cmd) print -Pn "\e]l%n@%m %~$1\e\\" # Never tested.. ;; - *term*|rxvt*) + *term*|rxvt*|putty) print -Pn "\e]0;%n@%m (%l) %~$1\a" # Sets term title ;; screen) diff --git a/12_Prompts.zsh b/12_Prompts.zsh index c8c0eca..b6cf511 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -24,7 +24,8 @@ set_prompt_colors $prompt_colors[generic] preexec () { - term_title " ··· $(echo $1 | tr ' \n' ' ;' | sed 's/%/%%/g;s/\\/\\\\/g')" + local my_sep=$([ "$TERM" = "putty" ] && echo "---" || echo "···") + term_title " $my_sep $(echo $1 | tr ' \n' ' ;' | sed 's/%/%%/g;s/\\/\\\\/g')" print -Pn "$C_$prompt_colors[exec]$_C" } -- cgit v1.2.3