From f1fb9827faec228246062f2cd8e38f0dd3338e3a Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Tue, 24 Mar 2015 20:16:29 +0900 Subject: Added ini file support --- libterm/term.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'libterm/term.c') diff --git a/libterm/term.c b/libterm/term.c index 532dc92..241b650 100644 --- a/libterm/term.c +++ b/libterm/term.c @@ -250,17 +250,26 @@ exit_error: } +#include //clean terminal with escape command int term_clr_scr( term_screen *ts ) { int ret = 0; - if ( write( ts->ofd, T_ESC "[H" T_ESC "[2J", 7 ) <= 0 ){}; + char s[] = T_ESC "[H" T_ESC "[2J"; + + + ASSERT( strlen(s)>0 ); + ASSERT( ts != NULL ); + ASSERT( ts->ofd > 0 ); + + if ( write( ts->ofd, s, strlen(s) ) <= 0 ){}; return ret; } + //set terminal default input/output behavior int term_set_raw_mode( term_screen *ts ) { -- cgit v1.2.3