aboutsummaryrefslogtreecommitdiff
path: root/src/line
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-18 14:57:06 +0000
committer_ov4 <ov4@ov4.org>2026-10-18 14:57:06 +0000
commitf7319b36f4f48cdf065b9a1472c9a848ca6f95bc (patch)
treecedef12b3a1e803c605157cbbba6d2c8c826338d /src/line
parentcd55aa462b112896240ab736bf60035fdb30ca2d (diff)
adapt self pipe
Diffstat (limited to 'src/line')
-rw-r--r--src/line/cursor.cc1
-rw-r--r--src/line/input.cc12
2 files changed, 11 insertions, 2 deletions
diff --git a/src/line/cursor.cc b/src/line/cursor.cc
index 81454ae..1baa33c 100644
--- a/src/line/cursor.cc
+++ b/src/line/cursor.cc
@@ -228,6 +228,7 @@ void T_line_editor::check_window_update()
{
update_window_size();
clear_below();
+ print_override(line_buffer);
windows_size_changed = false;
}
}
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));