about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-02-02 23:17:47 +0000
committerJames Booth <boothj5@gmail.com>2015-02-02 23:17:47 +0000
commit1c157b04df75a71672d97ba970fc1a24a2f10a3c (patch)
tree19d55fbf5bc8d96430e7ae6cf17adb709b63db17 /src
parent5954c0d2fe398213b29a8b4aa60340d49bf9946e (diff)
downloadprofani-tty-1c157b04df75a71672d97ba970fc1a24a2f10a3c.tar.gz
Fixed arrow keys with debug
Diffstat (limited to 'src')
-rw-r--r--src/ui/core.c1
-rw-r--r--src/ui/inputwin.c9
2 files changed, 3 insertions, 7 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index d6b45bde..de3bafd2 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -97,7 +97,6 @@ ui_init(void)
     nonl();
     cbreak();
     noecho();
-    leaveok(stdscr, FALSE);
     keypad(stdscr, TRUE);
     if (prefs_get_boolean(PREF_MOUSE)) {
         mousemask(ALL_MOUSE_EVENTS, NULL);
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c
index 0c1c617e..02278adf 100644
--- a/src/ui/inputwin.c
+++ b/src/ui/inputwin.c
@@ -102,7 +102,7 @@ cb_linehandler(char *line)
 int
 prof_rl_getc(FILE *filein)
 {
-    int ch = getc(stdin);
+    int ch = rl_getc(filein);
     if (_printable(ch)) {
         cmd_reset_autocomplete();
     }
@@ -293,13 +293,11 @@ startup_hook(void)
 void
 create_input_window(void)
 {
-/*
 #ifdef NCURSES_REENTRANT
     set_escdelay(25);
 #else
     ESCDELAY = 25;
 #endif
-*/
 	p_rl_timeout.tv_sec = 0;
     p_rl_timeout.tv_usec = inp_timeout * 1000;
 
@@ -433,16 +431,15 @@ inp_readline(void)
 
     if (FD_ISSET(fileno(rl_instream), &fds)) {
         rl_callback_read_char();
-        cons_debug("LINE: %s", rl_line_buffer);
-        cons_debug("POS : %d", rl_point);
 
         if (rl_line_buffer && rl_line_buffer[0] != '/' && rl_line_buffer[0] != '\0' && rl_line_buffer[0] != '\n') {
             prof_handle_activity();
         }
 
         ui_reset_idle_time();
-        inp_nonblocking(TRUE);
+        cons_show("");
         inp_write(rl_line_buffer, rl_point);
+        inp_nonblocking(TRUE);
     } else {
         inp_nonblocking(FALSE);
         prof_handle_idle();