diff options
Diffstat (limited to 'lib/terminal.c')
-rw-r--r-- | lib/terminal.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/terminal.c b/lib/terminal.c index adc2a49..528eae0 100644 --- a/lib/terminal.c +++ b/lib/terminal.c @@ -11,28 +11,28 @@ struct termios initial_settings, new_settings; void initterm(void) { - tcgetattr(fileno(input), &initial_settings); - new_settings = initial_settings; - new_settings.c_lflag &= ~ICANON; - new_settings.c_lflag &= ~ECHO; - new_settings.c_cc[VMIN] = 1; - new_settings.c_cc[VTIME] = 0; - new_settings.c_lflag &= ~ISIG; + tcgetattr(fileno(input), &initial_settings); + new_settings = initial_settings; + new_settings.c_lflag &= ~ICANON; + new_settings.c_lflag &= ~ECHO; + new_settings.c_cc[VMIN] = 1; + new_settings.c_cc[VTIME] = 0; + new_settings.c_lflag &= ~ISIG; - if (tcsetattr(fileno(input), TCSANOW, &new_settings) != 0) { - exception(1, _("could not set terminal attributes")); - } + if (tcsetattr(fileno(input), TCSANOW, &new_settings) != 0) { + exception(1, _("could not set terminal attributes")); + } } void clearterm(void) { - tcsetattr(fileno(input), TCSANOW, &initial_settings); + tcsetattr(fileno(input), TCSANOW, &initial_settings); } void openterm(void) { - if (!(input = fopen("/dev/tty", "r"))) { - exception(1, _("could not open terminal")); - } + if (!(input = fopen("/dev/tty", "r"))) { + exception(1, _("could not open terminal")); + } } |