Bläddra i källkod

[F] Fix cols coloring reset for bash 3.2

Introduce by #24
Hykilpikonna 2 år sedan
förälder
incheckning
700f651378
1 ändrade filer med 7 tillägg och 2 borttagningar
  1. 7 2
      neofetch

+ 7 - 2
neofetch

@@ -4656,8 +4656,13 @@ get_cols() {
         printf -v block_spaces "%${block_height}s"
 
         # Convert the spaces into rows of blocks.
-        [[ "$blocks"  ]] && cols+="${block_spaces// /${blocks}\[mnl}"
-        [[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}\[mnl}"
+        if [[ $BASH_VERSION == 3* ]]; then
+            [[ "$blocks"  ]] && cols+="${block_spaces// /${blocks}nl}"
+            [[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}nl}"
+        else
+            [[ "$blocks"  ]] && cols+="${block_spaces// /${blocks}\[mnl}"
+            [[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}\[mnl}"
+        fi
 
         # Determine the horizontal offset of the blocks.
         case $col_offset in