summaryrefslogtreecommitdiff
path: root/src/fe-text
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-10-28 19:20:59 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-10-28 19:20:59 +0000
commit3826079dbab92df9fcab1430b9eee90bc8a2eb32 (patch)
tree4cd1e1aa4228bc604e7e7849632c3394a0ce751d /src/fe-text
parent83324a0ed56366e0897b81625d36ddd5be5a6261 (diff)
downloadirssi-3826079dbab92df9fcab1430b9eee90bc8a2eb32.zip
Use TCSADRAIN option when changing terminfo settings.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1928 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r--src/fe-text/term-curses.c4
-rw-r--r--src/fe-text/terminfo-core.c9
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)