Always restore terminal mode in TUI cleanup - sacc - sacc(omys), simple console gopher client
git clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/sacc/
Log
Files
Refs
Tags
LICENSE
---
commit eae2a995544b2b48c3a7debcb186a00aa0c400b3
parent 6582965f7a534eb82339208980582fcb661fe7c3
Author: Quentin Rameau 
Date:   Mon, 22 Mar 2021 18:44:01 +0100

Always restore terminal mode in TUI cleanup

Thanks to Hiltjo for spotting that

Diffstat:
  M ui_ti.c                             |       3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/ui_ti.c b/ui_ti.c
@@ -50,12 +50,13 @@ uisetup(void)
 void
 uicleanup(void)
 {
+        tcsetattr(0, TCSANOW, &tsave);
+
         if (termset != OK)
                 return;
 
         putp(tparm(change_scroll_region, 0, lines-1, 0, 0, 0, 0, 0, 0, 0));
         putp(tparm(clear_screen, 0, 0, 0, 0, 0, 0, 0, 0, 0));
-        tcsetattr(0, TCSANOW, &tsave);
         fflush(stdout);
 }