From 976cc75483fc8e058db45b8b48f09c2552afc8de Mon Sep 17 00:00:00 2001 From: Vomitblood Date: Mon, 22 Apr 2024 20:31:55 +0800 Subject: [PATCH] fixed terminal color not resetting --- src/print.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/print.rs b/src/print.rs index ddb6b2a..8cf1658 100644 --- a/src/print.rs +++ b/src/print.rs @@ -55,8 +55,10 @@ pub fn print( // generate a list of slugs let slugs = generate_slug_list(big, forms, &pokedexes, shiny_rate); - // print the names of the slugs, separated by comma - print_name(&slugs); + // if hide_name is false then print the names of the slugs, separated by comma + if !hide_name { + print_name(&slugs); + } // print the actual thing print_colorscripts(&slugs, spacing).unwrap(); @@ -325,5 +327,8 @@ fn print_colorscripts( println!("{}", line_to_print); } + // reset terminal color by printing a reset code + println!("\x1b[0m"); + Ok(()) }