mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
Subject: [PATCH 3/5] output: use '[0m' to reset colors
Date: Mon, 23 Jan 2017 18:02:16 +0100	[thread overview]
Message-ID: <20170123170218.25139-4-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <20170123170218.25139-1-m.olbrich@pengutronix.de>

'[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 <m.olbrich@pengutronix.de>
---
 commands/2048.c   | 2 +-
 common/menu.c     | 2 +-
 include/readkey.h | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/commands/2048.c b/commands/2048.c
index 5ceb5cfb7d12..865803a5a616 100644
--- a/commands/2048.c
+++ b/commands/2048.c
@@ -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);
diff --git a/common/menu.c b/common/menu.c
index e757216c5adf..31e5c90a0f27 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -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)
diff --git a/include/readkey.h b/include/readkey.h
index 8398ec2e516e..ed1cd1542d6f 100644
--- a/include/readkey.h
+++ b/include/readkey.h
@@ -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")
 
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-01-23 17:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 17:02 [PATCH 0/5] EFI fixes Michael Olbrich
2017-01-23 17:02 ` [PATCH 1/5] readkey: keys are unsigned char Michael Olbrich
2017-01-23 17:02 ` [PATCH 2/5] serial: efi: improve input handling Michael Olbrich
2017-01-23 17:02 ` Michael Olbrich [this message]
2017-01-23 17:02 ` [PATCH 4/5] efi: include and execute exit calls Michael Olbrich
2017-01-23 17:02 ` [PATCH 5/5] efi: don't unload drivers Michael Olbrich
2017-01-24  8:35 ` [PATCH 0/5] EFI fixes Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170123170218.25139-4-m.olbrich@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox