aboutsummaryrefslogtreecommitdiff
path: root/src/line/input.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/line/input.cc')
-rw-r--r--src/line/input.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/line/input.cc b/src/line/input.cc
index b7dbc23..1e7ca38 100644
--- a/src/line/input.cc
+++ b/src/line/input.cc
@@ -5,6 +5,8 @@
#include <unistd.h>
#include "history.h"
+#include "util/non_block_input.h"
+#include "pipe.h"
using namespace std;
@@ -25,9 +27,15 @@ string T_line_editor::readline()
T_position pos = get_cursor_position();
prompt_pos = pos.col;
- char c;
- while (read(STDIN_FILENO, &c, 1) == 1)
+ char c; int src;
+ while (non_block_read_char(&c, &src) == 1)
{
+ // if signal'd
+ if (src == self_pipe_fd[0])
+ {
+ check_window_update();
+ break;
+ }
if (iscntrl(c))
{
//print("control: {}\r\n", static_cast<unsigned char>(c));