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/main.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/main.cc') diff --git a/src/main.cc b/src/main.cc index 55f669a..6fe48a4 100644 --- a/src/main.cc +++ b/src/main.cc @@ -48,16 +48,12 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char **argv) while (1) { /* Read command line */ - print_prompt(); + int len = print_prompt(); T_line_editor line_editor_instance; enable_raw(); - T_position pos = line_editor_instance.get_cursor_position(); - line_editor_instance.cursor_row = pos.row; - line_editor_instance.cursor_col = pos.col; - line_editor_instance.prompt_pos = line_editor_instance.cursor_col; - string s = line_editor_instance.readline(); + string s = line_editor_instance.readline(len); disable_raw(); cout << "\n\n\n\n" << endl; cout << s << endl; -- cgit v1.3.1-4-g156e