intirain 4 роки тому
батько
коміт
ba285f25e7
4 змінених файлів з 17 додано та 3 видалено
  1. 1 1
      Makefile
  2. 1 0
      include/vcc/pretty.h
  3. 2 2
      include/vcc/version.h
  4. 13 0
      pretty.c

+ 1 - 1
Makefile

@@ -1,6 +1,6 @@
 VCC_MAJOR 		= 1
 VCC_MINOR 		= 5
-VCC_PATCH 		= 0
+VCC_PATCH 		= 1
 VCC_STR 		= -rc 
 
 VCC_COMPILE_TIME 	= $(shell date)

+ 1 - 0
include/vcc/pretty.h

@@ -70,6 +70,7 @@ struct theme {
 			sysusername, 
 			msg, 
 			sysmsg, 
+			sid, 
 			time, 
 			errmsg, 
 			helpcmd, 

+ 2 - 2
include/vcc/version.h

@@ -1,2 +1,2 @@
-#define VCC_VERSION "VCC 1.5.0 Sat Mar 26 21:45:34 CST 2022 root"
-#define VCC_SEMVER "vcc 1.5.0-rc "
+#define VCC_VERSION "VCC 1.5.1 Sat Mar 26 21:55:07 CST 2022 root"
+#define VCC_SEMVER "vcc 1.5.1-rc "

+ 13 - 0
pretty.c

@@ -29,6 +29,8 @@
 #include <vcc/pretty.h>
 
 
+extern int current_sid;
+
 struct theme theme_def = {
 	.usrname = {
 		.fg = FG_LIGHTBLUE, 
@@ -54,6 +56,12 @@ struct theme theme_def = {
 		.mode = MODE_HIGHLIGHT
 	}, 
 
+	.sid = {
+		.fg = FG_RED, 
+		.bg = BG_BLACK ,
+		.mode = MODE_HIGHLIGHT
+	}, 
+
 	.time = {
 		.fg = FG_YELLOW, 
 		.bg = BG_BLACK, 
@@ -85,6 +93,7 @@ struct theme *current_theme = &theme_def;
 #define curr_sysusername 	(&current_theme->sysusername)
 #define curr_msg 		(&current_theme->msg)
 #define curr_sysmsg 		(&current_theme->sysmsg)
+#define curr_sid 		(&current_theme->sid)
 #define curr_time 		(&current_theme->time)
 #define curr_errmsg 		(&current_theme->errmsg)
 #define curr_helpcmd 		(&current_theme->helpcmd)
@@ -134,6 +143,10 @@ int pretty_new_msg(char *usrname, char *buf) {
 
 int pretty_prompt(char *usrname) {
 	ansi_csi_st(stderr, MODE_HIGHLIGHT, FG_BLACK, BG_BLACK);
+
+	setcolor(stderr, curr_sid);
+	fprintf(stderr, "#%03d ", current_sid);
+
 	setcolor(stderr, curr_usrname);
 	fprintf(stderr, "%s", usrname);