summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-04-08 20:43:49 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-04-08 20:43:49 +0200
commit1c2c2bccbb9a863aaa0f3cdbc9b11d8e949f7eb7 (patch)
tree9a3295e330b540a78e99960979545e0bd3988642
parentba659a99e13db27b3cb10691a1c41863733bc93f (diff)
downloadjson-rpc-shell-1c2c2bccbb9a863aaa0f3cdbc9b11d8e949f7eb7.tar.gz
json-rpc-shell-1c2c2bccbb9a863aaa0f3cdbc9b11d8e949f7eb7.tar.xz
json-rpc-shell-1c2c2bccbb9a863aaa0f3cdbc9b11d8e949f7eb7.zip
Move a comment
-rw-r--r--json-rpc-shell.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/json-rpc-shell.c b/json-rpc-shell.c
index 9d542a2..de88e6b 100644
--- a/json-rpc-shell.c
+++ b/json-rpc-shell.c
@@ -2148,8 +2148,6 @@ main (int argc, char *argv[])
// the socket don't terminate the program
(void) signal (SIGPIPE, SIG_IGN);
- // readline 6.3 doesn't immediately redraw the terminal upon reception
- // of SIGWINCH, so we must run it in an event loop to remediate that
struct ev_loop *loop = EV_DEFAULT;
if (!loop)
exit_fatal ("libev initialization failed");
@@ -2171,10 +2169,14 @@ main (int argc, char *argv[])
ev_io_init (&tty_watcher, on_tty_readable, STDIN_FILENO, EV_READ);
ev_io_start (EV_DEFAULT_ &tty_watcher);
+ // readline 6.3 doesn't immediately redraw the terminal upon reception
+ // of SIGWINCH, so we must run it in an event loop to remediate that
rl_catch_sigwinch = false;
g_ctx.readline_prompt_shown = true;
rl_callback_handler_install (g_ctx.readline_prompt, on_readline_input);
+
ev_run (loop, 0);
+
if (g_ctx.readline_prompt_shown)
rl_callback_handler_remove ();
putchar ('\n');