diff options
author | James Booth <boothj5@gmail.com> | 2015-12-01 22:24:43 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-12-01 22:24:43 +0000 |
commit | 1e6a1f9921335bfd39f62b338a90dde41f2dbafb (patch) | |
tree | 3426f4f26a43cdbd31e96a41c26ee1f7b8987206 | |
parent | d35f30f382fc84c99f2bb8c74ea87edcb73ff831 (diff) | |
download | profani-tty-1e6a1f9921335bfd39f62b338a90dde41f2dbafb.tar.gz |
readline: set rl_outstream to /dev/null
-rw-r--r-- | src/ui/inputwin.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 06e055ea..4c8f1d60 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -37,6 +37,7 @@ #include <stdlib.h> #include <string.h> +#include <stdio.h> #include <wchar.h> #include <sys/time.h> #include <errno.h> @@ -74,6 +75,7 @@ static struct timeval p_rl_timeout; static gint inp_timeout = 0; static gint no_input_count = 0; +static FILE *discard; static fd_set fds; static int r; static char *inp_line = NULL; @@ -115,6 +117,8 @@ create_input_window(void) #else ESCDELAY = 25; #endif + discard = fopen("/dev/null", "a"); + rl_outstream = discard; rl_readline_name = "profanity"; rl_getc_function = _inp_rl_getc; rl_startup_hook = _inp_rl_startup_hook; @@ -222,6 +226,7 @@ void inp_close(void) { rl_callback_handler_remove(); + fclose(discard); } char* |