From 3753b2236501b3cb0fc15ccd5c2e7a180ce6b780 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 24 Mar 2023 09:41:25 -0700 Subject: [PATCH] Minor fix in 1998/chaos - restore terminal at exit The problem with not calling 'endwin()' is that echo will be disabled which is a problem for the user if they don't know to type stty echo or reset or stty sane. --- 1998/chaos/README.md | 3 +++ 1998/chaos/chaos.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/1998/chaos/README.md b/1998/chaos/README.md index e79098f09..e421ff382 100644 --- a/1998/chaos/README.md +++ b/1998/chaos/README.md @@ -18,6 +18,9 @@ Or you can build this entry without the `halfdelay()` call by: make chaos_nohalf +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) added a call to +`endwin()` to restore terminal sanity (echo etc.) when exiting the program. +Thank you Cody for your assistance! ## To run: diff --git a/1998/chaos/chaos.c b/1998/chaos/chaos.c index 078906902..71245c17a 100644 --- a/1998/chaos/chaos.c +++ b/1998/chaos/chaos.c @@ -48,7 +48,7 @@ A main(A N,char ** Y) { _('u',-,2,0,1) _('i',-,1,0,2) G += M=='a'?-.1:M=='z'?.1:0; - if(M=='q') { printf("%.9s\n",P); exit(0); } + if(M=='q') { printf("%.9s\n",P); endwin(); exit(0); } memset(Q,0,3792); erase();