[PATCH BlueZ 1/2] shared/shell: Fix colors not using proper escape sequence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

According to readline documentation \001 and \002 has to be used to
delimit characters which takes no space:

  'Applications may indicate that the prompt contains characters that
  take up no physical screen space when displayed by bracketing a
  sequence of such characters with the special markers
  `RL_PROMPT_START_IGNORE' and `RL_PROMPT_END_IGNORE'.'
---
 src/shared/shell.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/shared/shell.h b/src/shared/shell.h
index 8b7cb7f30..e14d58381 100644
--- a/src/shared/shell.h
+++ b/src/shared/shell.h
@@ -22,14 +22,14 @@
  */
 #include <getopt.h>
 
-#define COLOR_OFF	"\x1B[0m"
-#define COLOR_RED	"\x1B[0;91m"
-#define COLOR_GREEN	"\x1B[0;92m"
-#define COLOR_YELLOW	"\x1B[0;93m"
-#define COLOR_BLUE	"\x1B[0;94m"
-#define COLOR_BOLDGRAY	"\x1B[1;30m"
-#define COLOR_BOLDWHITE	"\x1B[1;37m"
-#define COLOR_HIGHLIGHT	"\x1B[1;39m"
+#define COLOR_OFF	"\001\x1B[0m\002"
+#define COLOR_RED	"\001\x1B[0;91m\002"
+#define COLOR_GREEN	"\001\x1B[0;92m\002"
+#define COLOR_YELLOW	"\001\x1B[0;93m\002"
+#define COLOR_BLUE	"\001\x1B[0;94m\002"
+#define COLOR_BOLDGRAY	"\001\x1B[1;30m\002"
+#define COLOR_BOLDWHITE	"\001\x1B[1;37m\002"
+#define COLOR_HIGHLIGHT	"\001\x1B[1;39m\002"
 
 struct bt_shell_menu;
 
-- 
2.20.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux