From f7319b36f4f48cdf065b9a1472c9a848ca6f95bc Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sun, 18 Oct 2026 14:57:06 +0000 Subject: adapt self pipe --- src/line/input.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/line/input.cc') 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 #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(c)); -- cgit v1.3.1-4-g156e