From 3826079dbab92df9fcab1430b9eee90bc8a2eb32 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 28 Oct 2001 19:20:59 +0000 Subject: [PATCH] Use TCSADRAIN option when changing terminfo settings. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1928 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/term-curses.c | 4 ++-- src/fe-text/terminfo-core.c | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/fe-text/term-curses.c b/src/fe-text/term-curses.c index 02ac826b..e3b8e87b 100644 --- a/src/fe-text/term-curses.c +++ b/src/fe-text/term-curses.c @@ -83,7 +83,7 @@ static int init_curses(void) #ifdef VSUSP tio.c_cc[VSUSP] = _POSIX_VDISABLE; #endif - tcsetattr(0, 0, &tio); + tcsetattr(0, TCSADRAIN, &tio); } if (has_colors()) @@ -131,7 +131,7 @@ static int term_init_int(void) static void term_deinit_int(void) { - tcsetattr(0, 0, &old_tio); + tcsetattr(0, TCSADRAIN, &old_tio); endwin(); g_free_and_null(root_window); diff --git a/src/fe-text/terminfo-core.c b/src/fe-text/terminfo-core.c index 3dee2ffc..ad1e9253 100644 --- a/src/fe-text/terminfo-core.c +++ b/src/fe-text/terminfo-core.c @@ -364,7 +364,7 @@ static void terminfo_colors_deinit(TERM_REC *term) { int i; - if (terminfo_has_colors(term)) { + if (terminfo_is_colors_set(term)) { for (i = 0; i < 16; i++) { g_free(term->TI_fg[i]); g_free(term->TI_bg[i]); @@ -383,7 +383,8 @@ void terminfo_setup_colors(TERM_REC *term, int force) const char *bold, *blink; int i; - terminfo_colors_deinit(term); + terminfo_colors_deinit(term); + term->has_colors = term->TI_setf || term->TI_setaf; if (term->TI_setf) { for (i = 0; i < 8; i++) @@ -444,13 +445,13 @@ static void terminfo_input_init(TERM_REC *term) term->tio.c_cc[VSUSP] = _POSIX_VDISABLE; #endif - tcsetattr(fileno(term->in), 0, &term->tio); + tcsetattr(fileno(term->in), TCSADRAIN, &term->tio); } static void terminfo_input_deinit(TERM_REC *term) { - tcsetattr(fileno(term->in), 0, &term->old_tio); + tcsetattr(fileno(term->in), TCSADRAIN, &term->old_tio); } void terminfo_cont(TERM_REC *term)