Fix issues with color blocks adding random newlines to the terminal
This commit is contained in:
parent
51aa7d01cd
commit
cf95f70f85
17
neofetch
17
neofetch
|
@ -2019,17 +2019,16 @@ getcols () {
|
||||||
start=$((start+=1))
|
start=$((start+=1))
|
||||||
done
|
done
|
||||||
|
|
||||||
# Add padding and newline to the end of the blocks.
|
|
||||||
blocks+="${clear}\n${padding}"
|
|
||||||
blocks2+="${clear}\n${padding}"
|
|
||||||
|
|
||||||
# Convert height into spaces.
|
# Convert height into spaces.
|
||||||
cols="$(printf "%${block_height}s")"
|
spaces="$(printf "%${block_height}s")"
|
||||||
cols2="$(printf "%${block_height}s")"
|
|
||||||
|
|
||||||
# Print the blocks.
|
# Convert the spaces into rows of blocks.
|
||||||
cols=${cols// /${blocks}}
|
[ ! -z "$blocks" ] && cols+=${spaces// /${blocks}${clear}nl}
|
||||||
cols+=${cols2// /${blocks2}}
|
[ ! -z "$blocks2" ] && cols+=${spaces// /${blocks2}${clear}nl}
|
||||||
|
|
||||||
|
# Add newlines to the string.
|
||||||
|
cols=${cols%%'nl'}
|
||||||
|
cols=${cols//nl/\\n${padding}}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue