Browse Source

[F] Remove new line after clear screen

Azalea (on HyDEV-Daisy) 3 years ago
parent
commit
f86792356e
2 changed files with 4 additions and 2 deletions
  1. 1 1
      hyfetch/color_util.py
  2. 3 1
      hyfetch/main.py

+ 1 - 1
hyfetch/color_util.py

@@ -53,7 +53,7 @@ def clear_screen():
     """
     Clear screen using ANSI escape codes
     """
-    print('\033[2J\033[H')
+    print('\033[2J\033[H', end='')
 
 
 def redistribute_rgb(r: int, g: int, b: int) -> tuple[int, int, int]:

+ 3 - 1
hyfetch/main.py

@@ -9,7 +9,7 @@ from dataclasses import dataclass
 from pathlib import Path
 from typing import Iterable
 
-from .color_util import AnsiMode, printc, color
+from .color_util import AnsiMode, printc, color, clear_screen
 from .neofetch_util import run_neofetch, replace_colors, get_custom_distro_ascii
 from .presets import PRESETS, ColorProfile
 from .serializer import json_stringify
@@ -103,6 +103,7 @@ def create_config() -> Config:
 
     :return: Config object (automatically stored)
     """
+    clear_screen()
     printc('\nWelcome to &b&lhy&f&lfetch&r! Let\'s set up some colors first.\n')
 
     # Select color system
@@ -128,6 +129,7 @@ def create_config() -> Config:
         color_system = literal_input('Which &acolor &bsystem &rdo you want to use?',
                                      ['8bit', 'rgb'], 'rgb')
 
+    clear_screen()
 
     # Print preset
     print('Available presets:\n')