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/line/input.cc | |
| parent | 83588b7ee9349a941b91294fa83fe6e207883ab6 (diff) | |
fix vt100 cursor pos race
Diffstat (limited to 'src/line/input.cc')
| -rw-r--r-- | src/line/input.cc | 5 |
1 files changed, 2 insertions, 3 deletions
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) { |
