static void read_settings(void) { const char *str; int old_colors = term_use_colors; int old_type = term_type; term_auto_detach(settings_get_bool("term_auto_detach")); /* set terminal type */ str = settings_get_str("term_charset"); if (g_strcasecmp(str, "utf-8") == 0) term_type = TERM_TYPE_UTF8; else if (g_strcasecmp(str, "big5") == 0) term_type = TERM_TYPE_BIG5; else term_type = TERM_TYPE_8BIT; if (old_type != term_type) term_set_input_type(term_type); /* change color stuff */ if (force_colors != settings_get_bool("term_force_colors")) { force_colors = settings_get_bool("term_force_colors"); term_force_colors(force_colors); } term_use_colors = settings_get_bool("colors") && (force_colors || term_has_colors()); if (term_use_colors != old_colors) irssi_redraw(); }
static void read_settings(void) { const char *str; int old_colors = term_use_colors; int old_colors24 = term_use_colors24; int old_type = term_type; /* set terminal type */ str = settings_get_str("term_charset"); if (g_ascii_strcasecmp(str, "utf-8") == 0) term_type = TERM_TYPE_UTF8; else if (g_ascii_strcasecmp(str, "big5") == 0) term_type = TERM_TYPE_BIG5; else term_type = TERM_TYPE_8BIT; if (old_type != term_type) term_set_input_type(term_type); /* change color stuff */ if (force_colors != settings_get_bool("term_force_colors")) { force_colors = settings_get_bool("term_force_colors"); term_force_colors(force_colors); } term_use_colors = settings_get_bool("colors") && (force_colors || term_has_colors()); #ifdef TERM_TRUECOLOR term_use_colors24 = settings_get_bool("colors_ansi_24bit") && (force_colors || term_has_colors()); #else term_use_colors24 = FALSE; #endif if (term_use_colors != old_colors || term_use_colors24 != old_colors24) irssi_redraw(); }