From fb5860bd26dd6c212ba39a8f4cae371fffc32d36 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Sun, 12 Aug 2012 10:51:29 +0200 Subject: [PATCH 1/2] Fix bug in shorten_path for zsh --- liquidprompt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/liquidprompt b/liquidprompt index f04874f..96318d2 100755 --- a/liquidprompt +++ b/liquidprompt @@ -408,7 +408,11 @@ __shorten_path() echo "$p" fi elif [[ "$WORKING_SHELL" == "zsh" ]]; then - echo "%-${keep}~%${max_len}<${mask}<%~%<<" + if [[ "$len" -gt "$max_len" ]]; then + echo "%-${keep}~%${max_len}<${mask}<%~%<<" + else + echo "%~" + fi fi } From 2810d481aa44cbfcd06753907247e94eb3ff784f Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Sun, 12 Aug 2012 10:52:03 +0200 Subject: [PATCH 2/2] Fix typo and remove trailing space --- liquidprompt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/liquidprompt b/liquidprompt index 96318d2..4875d53 100755 --- a/liquidprompt +++ b/liquidprompt @@ -421,7 +421,7 @@ __shorten_path() # colored in red if it have not. __permissions_color() { - if [[ -w "${PWD}" ]]; then + if [[ -w "${PWD}" ]]; then echo "${GREEN}:${NO_COL}" else echo "${RED}:${NO_COL}" @@ -663,6 +663,7 @@ __battery_color() elif [[ "$WORKING_SHELL" == "zsh" ]]; then echo -ne "${ret}${bat}%%${NO_COL}" fi + fi }