$Log$
+ Revision 601.65 2002/11/11 06:21:55 error
+ * Fixed minor bugs with color handling; added explicit support for handling
+ the background color e.g. for transparent terminals
+
Revision 601.64 2002/11/11 04:17:24 ajc
* More work on reply to meeting invitation
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
enable_color = 0;
}
- scr_printf("%s\nAccess level: %d (%s)\n"
+ color(BRIGHT_WHITE);
+ scr_printf("\n%s\nAccess level: %d (%s)\n"
"User #%ld / Login #%d",
fullname, axlevel, axdefs[(int) axlevel],
usernum, timescalled);
if (lastcall > 0L) {
- scr_printf(" / Last login: %s\n",
+ scr_printf(" / Last login: %s",
asctime(localtime(&lastcall)));
}
scr_printf("\n");
} /* end switch */
} while (termn8 == 0);
- TERMN8: scr_printf("%s logged out.\n", fullname);
+TERMN8: scr_printf("%s logged out.", fullname);
+ color(ORIGINAL_PAIR);
+ scr_printf("\n");
while (march != NULL) {
remove_march(march->march_name, 0);
}
#
ansi_color=user
+# USE_BACKGROUND controls Citadel's use of the background. If it is turned
+# off, then Citadel will set the background to black. When it is turned on,
+# the background will be unchanged. This is most useful with "transparent"
+# terminals. Color must be on (see above) or this option has no effect.
+#
+use_background=off
+
# PROMPT_CONTROL should be set to on/off/user to control whether the <N>ext
# and <S>top keys are active when displaying the paginator prompt. If it
# is set to "user" then it's a user-configurable option.
int rc_force_mail_prompts;
int rc_remember_passwords;
int rc_ansi_color;
+int rc_color_use_bg;
int num_urls = 0;
int rc_prompt_control = 0;
time_t rc_idle_threshold = (time_t)900;
rc_display_message_numbers = 0;
rc_force_mail_prompts = 0;
rc_ansi_color = 0;
+ rc_color_use_bg = 0;
strcpy(rc_url_cmd, "");
strcpy(rc_gotmail_cmd, "");
#ifdef HAVE_OPENSSL
if (!strncasecmp(&buf[11], "user", 4))
rc_ansi_color = 3; /* user config */
}
+ if (!strncasecmp(buf, "use_background=", 15)) {
+ if (!strncasecmp(&buf[15], "on", 2))
+ rc_color_use_bg = 9;
+ }
if (!strncasecmp(buf, "prompt_control=", 15)) {
if (!strncasecmp(&buf[15], "on", 2))
rc_prompt_control = 1;
*/
void color(int colornum)
{
- static int is_bold = 0;
- static int hold_color, current_color;
+ static int hold_color;
+ static int current_color;
if (colornum == COLOR_PUSH) {
hold_color = current_color;
* to mention transparent terminals.
*/
if (colornum == ORIGINAL_PAIR)
- printf("\033[39;49m");
+ printf("\033[0;39;49m");
else
- printf("\033[3%d;40m", (colornum & 7));
-
- if ((colornum >= 8) && (is_bold == 0)) {
- printf("\033[1m");
- is_bold = 1;
- } else if ((colornum < 8) && (is_bold == 1)) {
- printf("\033[0m");
- is_bold = 0;
- }
+ printf("\033[%d;3%d;4%dm",
+ (colornum & 8) ? 1 : 0,
+ (colornum & 7),
+ rc_color_use_bg);
+
scr_flush();
}
}
void cls(int colornum)
{
if (enable_color) {
- printf("\033[4%dm\033[2J\033[H\033[0m", colornum);
+ printf("\033[4%dm\033[2J\033[H\033[0m",
+ colornum ? colornum : rc_color_use_bg);
scr_flush();
}
}