From c57ac089c97db65e6e795bf45c266b645025e654 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Thu, 2 Mar 2017 07:36:29 +0100 Subject: Move horizontal rule out of prompt Simplifies the code somewhat; less arguments to pass around. --- .bash_prompt | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to '.bash_prompt') diff --git a/.bash_prompt b/.bash_prompt index 712c95e..7a55f35 100644 --- a/.bash_prompt +++ b/.bash_prompt @@ -113,19 +113,9 @@ __fontify () __set-prompt () { - local last_status=$1 BUILDING_PS1=t PS1='' - if [ ${last_status} -ne 0 ] - then - local error="${last_status} " - PS1+=$(__fontify "${error}" bold red) - PS1+="$(__draw-rule $((COLUMNS-${#error})) dim red)" - else - PS1+="$(__draw-rule ${COLUMNS} dim)" - fi - PS1+="$(__write-context)\n" PS1+=$(__fontify '\$' dim) PS1+=' ' @@ -158,12 +148,9 @@ __signal-no-newline () __draw-rule () { - local length=$1 - shift - local line='' - for ((i=1; i