summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2014-06-16 15:04:08 +0200
committerLars-Dominik Braun <lars@6xq.net>2014-06-16 15:04:08 +0200
commit0117308ab5509a5c31b7778f9551f7335c553f77 (patch)
treef593cb6ced9ce3e7e246545f5db8e7410de28e0e /src/main.c
parent8cc95de0834c5217b080ad25907501f5ad152f6e (diff)
downloadpianobar-0117308ab5509a5c31b7778f9551f7335c553f77.tar.gz
pianobar-0117308ab5509a5c31b7778f9551f7335c553f77.tar.bz2
pianobar-0117308ab5509a5c31b7778f9551f7335c553f77.zip
Re-init terminal when awaking from ^Z
And simplify code that nobody touched in a long long timeā€¦ Fixes input issues reported in #458.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 2 insertions, 6 deletions
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;
}