Fix prompt precmd spacing.
Only add spaces if there is content.
This commit is contained in:
4
pure.zsh
4
pure.zsh
@@ -20,6 +20,7 @@
|
||||
# turns seconds into human readable time
|
||||
# 165392 => 1d 21h 56m 32s
|
||||
prompt_pure_human_time() {
|
||||
echo -n " "
|
||||
local tmp=$1
|
||||
local days=$(( tmp / 60 / 60 / 24 ))
|
||||
local hours=$(( tmp / 60 / 60 % 24 ))
|
||||
@@ -61,7 +62,8 @@ prompt_pure_preexec() {
|
||||
|
||||
# string length ignoring ansi escapes
|
||||
prompt_pure_string_length() {
|
||||
echo ${#${(S%%)1//(\%([KF1]|)\{*\}|\%[Bbkf])}}
|
||||
# Subtract one since newline is counted as two characters
|
||||
echo $(( ${#${(S%%)1//(\%([KF1]|)\{*\}|\%[Bbkf])}} - 1 ))
|
||||
}
|
||||
|
||||
prompt_pure_precmd() {
|
||||
|
||||
Reference in New Issue
Block a user