From 0117308ab5509a5c31b7778f9551f7335c553f77 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 16 Jun 2014 15:04:08 +0200 Subject: Re-init terminal when awaking from ^Z MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And simplify code that nobody touched in a long long timeā€¦ Fixes input issues reported in #458. --- src/main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index fd87490..c4bb95a 100644 --- a/src/main.c +++ b/src/main.c @@ -414,15 +414,11 @@ static void BarMainLoop (BarApp_t *app) { int main (int argc, char **argv) { static BarApp_t app; - /* terminal attributes _before_ we started messing around with ~ECHO */ - struct termios termOrig; memset (&app, 0, sizeof (app)); /* save terminal attributes, before disabling echoing */ - BarTermSave (&termOrig); - BarTermSetEcho (0); - BarTermSetBuffer (0); + BarTermInit (); /* signals */ signal (SIGPIPE, SIG_IGN); @@ -506,7 +502,7 @@ int main (int argc, char **argv) { BarSettingsDestroy (&app.settings); /* restore terminal attributes, zsh doesn't need this, bash does... */ - BarTermRestore (&termOrig); + BarTermRestore (); return 0; } -- cgit v1.2.3