Skip to content

Commit

Permalink
output: use '[0m' to reset colors
Browse files Browse the repository at this point in the history
'[m' is supposed to have the same effect as '[0m'. However, some EFI
implementations seem to ignore '[m', so use '[0m' everywhere to avoid
rendering issues.

Signed-off-by: Michael Olbrich <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
  • Loading branch information
michaelolbrich authored and saschahauer committed Jan 24, 2017
1 parent 23a90fe commit 39db674
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion commands/2048.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void getColor(uint16_t value, char *color, size_t length)
static void drawBoard(uint16_t board[SIZE][SIZE])
{
int8_t x,y;
char color[40], reset[] = "\033[m";
char color[40], reset[] = "\033[0m";
printf("\033[H");

printf("2048.c %17d pts\n\n",score);
Expand Down
2 changes: 1 addition & 1 deletion common/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static void print_menu_entry(struct menu *m, struct menu_entry *me,
__print_entry(me->display);

if (selected)
puts("\e[m");
puts("\e[0m");
}

int menu_set_selected_entry(struct menu *m, struct menu_entry* me)
Expand Down
4 changes: 2 additions & 2 deletions include/readkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

#define ANSI_CLEAR_SCREEN "\e[2J\e[;H"

#define printf_reverse(fmt,args...) printf("\e[7m" fmt "\e[m",##args)
#define puts_reverse(fmt) puts("\e[7m" fmt "\e[m")
#define printf_reverse(fmt,args...) printf("\e[7m" fmt "\e[0m",##args)
#define puts_reverse(fmt) puts("\e[7m" fmt "\e[0m")
#define gotoXY(row, col) printf("\e[%d;%dH", col, row)
#define clear() puts("\e[2J")

Expand Down

0 comments on commit 39db674

Please sign in to comment.