From a69f6c9837e03b3c691ec4c55c7ecd833a15cb65 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Wed, 1 Mar 2017 07:39:08 +0100 Subject: Split prompt into two lines User/host/working-directory/Git status go on the first line; the "prompt" line only contains the prompt symbol and the previous command's error code. Also fill the rest of the line when a command does not end with a newline. --- .bash_prompt | 79 ++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 26 deletions(-) (limited to '.bash_prompt') diff --git a/.bash_prompt b/.bash_prompt index 55c94b6..3b9b62c 100644 --- a/.bash_prompt +++ b/.bash_prompt @@ -122,22 +122,6 @@ __set-prompt () PS1+=$(__fontify "${last_status} " bold red) fi - PS1+=$(__fontify '\u' green) - - if __show-hostname - then - PS1+=$(__fontify '@' dim) - PS1+=$(__fontify '\H' bold green) - fi - - PS1+=$(__fontify : dim) - PS1+=$(__fontify '\w' bold blue) - - if [ ${PS1_SHOWGITSTATUS} ] - then - PS1+=$(__fontify "$(__git_ps1 '(%s)')" red) - fi - PS1+=$(__fontify '\$' dim) PS1+=' ' @@ -161,30 +145,73 @@ __current-column () fi } -__draw-rule () +__fill-line () { - local rule='' - local column=$(__current-column) + local char=$1 + shift + + local line='' - for ((i=column; i<=COLUMNS; i++)) + for ((i=$(__current-column); i