summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 36abb30..a77bbb6 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -44,6 +44,7 @@
#include <errno.h>
#include <fcntl.h>
#include <sys/wait.h>
+#include <termios.h>
#include "calcurse.h"
@@ -1077,12 +1078,21 @@ child_wait (int *pfdin, int *pfdout, int pid)
void
press_any_key (void)
{
+ struct termios t_attr_old, t_attr;
+
+ tcgetattr (STDIN_FILENO, &t_attr_old);
+ memcpy (&t_attr, &t_attr_old, sizeof (struct termios));
+ t_attr.c_lflag &= ~(ICANON | ECHO | ECHONL);
+ tcsetattr (STDIN_FILENO, TCSAFLUSH, &t_attr);
+
fflush (stdout);
fputs (_("Press any key to continue..."), stdout);
fflush (stdout);
fgetc (stdin);
fflush (stdin);
fputs ("\r\n", stdout);
+
+ tcsetattr (STDIN_FILENO, TCSAFLUSH, &t_attr_old);
}
/*