diff options
Diffstat (limited to 'Functions')
-rw-r--r-- | Functions/Prompts/prompt_bart_setup | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/Functions/Prompts/prompt_bart_setup b/Functions/Prompts/prompt_bart_setup index d602cc9ec..0713a48af 100644 --- a/Functions/Prompts/prompt_bart_setup +++ b/Functions/Prompts/prompt_bart_setup @@ -57,22 +57,13 @@ prompt_bart_precmd () { setopt localoptions noxtrace extendedglob noksharrays # Using psvar here protects against unwanted promptsubst expansions. - psvar[8]="$history[$#history]" # Use history text, not just number - psvar[9]='' # Padding before upper right prompt - - if [[ -o promptsubst ]] - then - # This is a bug workaround; ${(%)...} mishandles promptsubst - repeat $[COLUMNS-${#${(%f)${${(e)PS1}//[%]\{[^%]#%\}/}}[1]}-1] - do - psvar[9]="$psvar[9] " - done - else - repeat $[COLUMNS-${#${(%f)${PS1//[%]\{[^%]#%\}/}}[1]}-1] - do - psvar[9]="$psvar[9] " - done - fi + psvar[8]="$history[$[${(%):-%h}-1]]" # Use history text, not just number + psvar[9]='' # Padding before upper right prompt + + repeat $[COLUMNS-${#${(%%f)${PS1//[%]\{[^%]#%\}/}}[1]}-1] + do + psvar[9]="$psvar[9] " + done } prompt_bart_ps1 () { |