* citadel.c, commands.c, commands.h: set background color to black
authorNathan Bryant <loanshark@uncensored.citadel.org>
Sat, 31 Oct 1998 22:30:24 +0000 (22:30 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Sat, 31 Oct 1998 22:30:24 +0000 (22:30 +0000)
          before clearing screen, so that we can actually see text on
          black-on-white xterms.

citadel/ChangeLog
citadel/citadel.c
citadel/commands.c
citadel/commands.h

index 42cfdb5526f8da24001e6c179aec837a0868e226..2234e33e84617d0846a1f0da457397156acd378d 100644 (file)
@@ -1,3 +1,8 @@
+1998-10-31 Nathan Bryant <bryant@cs.usm.maine.edu>
+       * citadel.c, commands.c, commands.h: set background color to black
+         before clearing screen, so that we can actually see text on
+         black-on-white xterms.
+
 1998-10-29 Nathan Bryant <bryant@cs.usm.maine.edu>
        * rooms.c: fix color of Mail>
        * citadel.c: send ANSI detect sequence after attach_to_server() so the
index 4d452cc7ff9dd18b4ca22eedd35a354cd5bc9fb9..2eee6515cf3f0a1c402603025e656613039adb16 100644 (file)
@@ -816,10 +816,9 @@ signal(SIGCONT,catch_sigcont);  /* Catch SIGCONT so we can reset terminal */
 printf("Attaching to server...\r");
 fflush(stdout);
 attach_to_server(argc,argv);
+
 send_ansi_detect();
 
-cls();
-color(7);
 serv_gets(aaa);
 if (aaa[0]!='2') {
        printf("%s\n",&aaa[4]);
@@ -827,6 +826,10 @@ if (aaa[0]!='2') {
        }
 get_serv_info();
 
+look_for_ansi();
+cls(0);
+color(7);
+
 printf("%-22s\n%s\n%s\n",serv_info.serv_software,serv_info.serv_humannode,
        serv_info.serv_bbs_city);
 screenwidth = 80;              /* default screen dimensions */
@@ -847,8 +850,6 @@ if (getppid()!=1) {
                }
        }
 
-look_for_ansi();
-
 GSTA:  termn8=0; newnow=0;
        do {
                if (strlen(rc_username) > 0) {
index b77378496f27f5bb01ff229fbb31542680fcb33a..6af5de5ed67dbae408a2e572c6bcb07d64f2e5d1 100644 (file)
@@ -853,21 +853,20 @@ FMTEND:   printf("\n");
  */
 void color(int colornum)
 {
-
 #ifdef ANSI_COLOR
        if (enable_color) {
-               fflush(stdout);
-               printf("%c[3%dm%c[1m", 27, colornum, 27);
+               printf("\033[3%dm\033[1m", colornum);
                fflush(stdout);
                }
 #endif
        }
 
-void cls(void) {
+void cls(int colornum) {
 #ifdef ANSI_COLOR
-       fflush(stdout);
-       printf("%c[2J%c[H", 27, 27);
-       fflush(stdout);
+       if (enable_color) {
+               printf("\033[4%dm\033[2J\033[H", colornum);
+               fflush(stdout);
+               }
 #endif
        }
 
@@ -877,7 +876,7 @@ void cls(void) {
  */
 void send_ansi_detect(void) {
 #ifdef ANSI_COLOR
-       printf("%c[c", 27);
+       printf("\033[c");
        fflush(stdout);
        time(&AnsiDetect);
 #endif
index c2e01bbfddea51c86f9e358e5eca4ab243d8b1e7..eeb984dd20d34e1c634f43dd8784aa95f217cbd7 100644 (file)
@@ -7,7 +7,7 @@ int fmout(int width, FILE *fp, char pagin, int height, int starting_lp,
 int getcmd(char *argbuf);
 void display_help(char *name);
 void color(int colornum);
-void cls(void);
+void cls(int colornum);
 void send_ansi_detect(void);
 void look_for_ansi(void);
 int inkey(void);