summaryrefslogtreecommitdiff
path: root/lib/terminal.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/terminal.c')
-rw-r--r--lib/terminal.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/terminal.c b/lib/terminal.c
index ace1302..adc2a49 100644
--- a/lib/terminal.c
+++ b/lib/terminal.c
@@ -9,7 +9,8 @@
FILE *input;
struct termios initial_settings, new_settings;
-void initterm(void) {
+void initterm(void)
+{
tcgetattr(fileno(input), &initial_settings);
new_settings = initial_settings;
new_settings.c_lflag &= ~ICANON;
@@ -24,11 +25,13 @@ void initterm(void) {
}
-void clearterm(void) {
+void clearterm(void)
+{
tcsetattr(fileno(input), TCSANOW, &initial_settings);
}
-void openterm(void) {
+void openterm(void)
+{
if (!(input = fopen("/dev/tty", "r"))) {
exception(1, _("could not open terminal"));
}