From 97ae95fec62aacda51b461086b46dc0310e5f00e Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 30 Jan 2009 14:58:28 +0100 Subject: [PROMPT] recalculates horizontal bar before preexec --- 12_Prompts.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/12_Prompts.zsh b/12_Prompts.zsh index 23d76b8..46be226 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -39,6 +39,13 @@ preexec () local lines="$(expand_text "$PROMPT$1" | sed "s/\\(.\{$COLUMNS\}\\)/\\1\\n/g" | wc -l)" prompt_colors[date]=$date_colors[exec] set_prompt_date + + spaceleft=$(($COLUMNS - $AGENTSSIZE - $MAILSTATSIZE - $DATESIZE - $BATTERYSIZE)) + unset HBAR + for h in {1..$spaceleft} + do + HBAR=$HBAR- + done redisplay_prompt local string="$(expand_text "$PROMPT$1")" @@ -176,7 +183,6 @@ update_prompt() [ "$DEBUG" = "yes" ] && echo -n " Horizontal bar..." # First line of prompt, calculation of the remaining place spaceleft=$(($COLUMNS - $ERRORSIZE - $AGENTSSIZE - $MAILSTATSIZE - $DATESIZE - $BATTERYSIZE)) - unset HBAR for h in {1..$spaceleft} do -- cgit v1.2.3