Skip to content

Commit ed7c2c6

Browse files
author
karl
committed
don't set foreground color if set to default
if left to default this would print escape code 29 which luckily did nothing
1 parent 68dd3c8 commit ed7c2c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

output/terminal_noncurses.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ int init_terminal_noncurses(int tty, char *const fg_color_string, char *const bg
186186
if (col == 38) {
187187
struct colors fg_color = parse_color(fg_color_string);
188188
printf("\033[38;2;%d;%d;%dm", fg_color.rgb[0], fg_color.rgb[1], fg_color.rgb[2]);
189-
} else {
189+
} else if (col < 38 && col >= 30) {
190190
printf("\033[%dm", col); // setting color
191191
}
192192

0 commit comments

Comments
 (0)