mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-28 03:14:53 +08:00
Inject readline markers only if using readline
This commit is contained in:
parent
8d5f31757f
commit
b15f7c4789
1 changed files with 5 additions and 0 deletions
|
@ -32,12 +32,17 @@
|
|||
#define _CLEAR_ "\x1b[2J"
|
||||
#define _TOP_ "\x1b[1;1f"
|
||||
|
||||
|
||||
#if defined(HAVE_READLINE)
|
||||
// https://wiki.hackzine.org/development/misc/readline-color-prompt.html
|
||||
// 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 = '\001' and RL_PROMPT_END_IGNORE = '\002'
|
||||
#define RL_ESC(a) "\001" a "\002"
|
||||
#else
|
||||
#define RL_ESC(a) a
|
||||
#endif // HAVE_READLINE
|
||||
|
||||
#define _RL_RED_(s) RL_ESC("\x1b[31m") s RL_ESC(AEND)
|
||||
#define _RL_GREEN_(s) RL_ESC("\x1b[32m") s RL_ESC(AEND)
|
||||
|
|
Loading…
Reference in a new issue