diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-19 09:01:42 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-19 09:01:42 +0000 |
| commit | c23e61b4455cee8669c7d594478a4238048f032f (patch) | |
| tree | 084e9c90a440483797fdf64fb0fc43470d4b9d16 /src/main.cc | |
| parent | 83588b7ee9349a941b91294fa83fe6e207883ab6 (diff) | |
fix vt100 cursor pos race
Diffstat (limited to 'src/main.cc')
| -rw-r--r-- | src/main.cc | 8 |
1 files changed, 2 insertions, 6 deletions
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; |
