sacc

sacc (saccomys): simple gopher client.
Log | Files | Refs | LICENSE

commit 1b724721acb63d32ea730b80348b7d96a27bbe09
parent 5a23f2a6c54c154c997cf70eafecae6e90827ab5
Author: Quentin Rameau <quinq@fifth.space>
Date:   Mon, 10 Jul 2017 15:03:41 +0200

Only unset ICANON and ECHO instead of whole raw mode

Diffstat:
ui_ti.c | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/ui_ti.c b/ui_ti.c @@ -26,21 +26,23 @@ uisetup(void) struct termios traw; tcgetattr(0, &tsave); - traw = tsave; - cfmakeraw(&traw); - tcsetattr(0, TCSAFLUSH, &traw); + tsacc = tsave; + tsacc.c_lflag &= ~(ECHO|ICANON); + tcsetattr(0, TCSANOW, &tsacc); setupterm(NULL, 1, NULL); putp(tparm(save_cursor)); putp(tparm(change_scroll_region, 0, lines-2)); putp(tparm(restore_cursor)); + fflush(stdout); } void uicleanup(void) { - tcsetattr(0, TCSAFLUSH, &tsave); + putp(tparm(change_scroll_region, 0, lines-1)); putp(tparm(clear_screen)); + tcsetattr(0, TCSANOW, &tsave); fflush(stdout); } @@ -72,6 +74,7 @@ displaystatus(Item *item) putp(tparm(exit_standout_mode)); putp(tparm(restore_cursor)); + fflush(stdout); } void