mirror of
https://github.com/louisrubet/rpn
synced 2024-11-17 07:47:50 +01:00
Added ANSI escape sequences, prompt is bold
This commit is contained in:
parent
a1ed75252f
commit
897c0d5233
3 changed files with 34 additions and 1 deletions
32
src/escape.h
Normal file
32
src/escape.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
// ANSI escape sequences
|
||||
|
||||
// foreground colors
|
||||
#define FG_BLACK "\33[30m"
|
||||
#define FG_RED "\33[31m"
|
||||
#define FG_GREEN "\33[32m"
|
||||
#define FG_YELLOW "\33[33m"
|
||||
#define FG_BLUE "\33[34m"
|
||||
#define FG_MAJENTA "\33[35m"
|
||||
#define FG_CYAN "\33[36m"
|
||||
#define FG_WHITE "\33[37m"
|
||||
|
||||
// background colors
|
||||
#define BG_BLACK "\33[40m"
|
||||
#define BG_RED "\33[41m"
|
||||
#define BG_GREEN "\33[42m"
|
||||
#define BG_YELLOW "\33[43m"
|
||||
#define BG_BLUE "\33[44m"
|
||||
#define BG_MAJENTA "\33[45m"
|
||||
#define BG_CYAN "\33[46m"
|
||||
#define BG_WHITE "\33[47m"
|
||||
|
||||
#define COLOR_OFF "\33[m"
|
||||
|
||||
// attributes
|
||||
#define ATTR_BOLD "\33[1m"
|
||||
#define ATTR_UNDERSCORE "\33[4m"
|
||||
#define ATTR_BLINK "\33[5m"
|
||||
#define ATTR_REVERSE "\33[7m"
|
||||
#define ATTR_CONCEALED "\33[8m"
|
||||
|
||||
#define ATTR_OFF "\33[0m"
|
|
@ -52,6 +52,7 @@ static const int g_max_commands = 100;
|
|||
static int g_verbose = 0;
|
||||
|
||||
//
|
||||
#include "escape.h"
|
||||
#include "version.h"
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
static const char version[] = "1.3-beta";
|
||||
static const char uname[] = "rpn v1.3-beta, (c) 2015 <louis@rubet.fr>";
|
||||
static const char prompt[] = "rpn> ";
|
||||
static const char prompt[] = ATTR_BOLD "rpn" ATTR_OFF "> ";
|
||||
|
|
Loading…
Reference in a new issue