From c23e61b4455cee8669c7d594478a4238048f032f Mon Sep 17 00:00:00 2001 From: _ov4 Date: Mon, 19 Oct 2026 09:01:42 +0000 Subject: fix vt100 cursor pos race --- src/line/input.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/line/input.cc') diff --git a/src/line/input.cc b/src/line/input.cc index 0a01760..1b9520b 100644 --- a/src/line/input.cc +++ b/src/line/input.cc @@ -18,15 +18,14 @@ void T_line_editor::clear_below() print("\x1b[0J"); } -string T_line_editor::readline() +string T_line_editor::readline(int prompt_len) { + prompt_pos = prompt_len+1; update_window_size(); history_vec.push_back(""); history_index = get_last_index(); reset_editor(); - T_position pos = get_cursor_position(); - prompt_pos = pos.col; char c; int src; while (non_block_read_char(&c, &src) == 1) { -- cgit v1.3.1-4-g156e