aboutsummaryrefslogtreecommitdiff
path: root/src/line/cursor.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-08 15:41:39 +0000
committer_ov4 <ov4@ov4.org>2026-10-08 15:41:39 +0000
commitd29590546054feabff2d7e559665811d1d28f538 (patch)
tree40b00c9cd14e0f304a41ae8253c10af731dccd8a /src/line/cursor.cc
parentbc72606fd36c5088526a39363d5414a39178d49d (diff)
fix print_override
Diffstat (limited to 'src/line/cursor.cc')
-rw-r--r--src/line/cursor.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/line/cursor.cc b/src/line/cursor.cc
index 8379b83..42b1685 100644
--- a/src/line/cursor.cc
+++ b/src/line/cursor.cc
@@ -19,7 +19,10 @@ namespace ov4
void print_override(const std::string &s)
{
// save current cursor position
- print("\x1b[s"); fflush(stdout);
+ // print("\x1b[s"); fflush(stdout);
+ // WTF
+ // ESC 7 Save Cursor (DECSC), VT100.
+ print("\x1b" "7"); fflush(stdout);
// move to the "start" of the zone
// should skip prompt zone
@@ -34,7 +37,8 @@ void print_override(const std::string &s)
//line_end_pos = s.size()+1;
// restore cursor position
- print("\x1b[u"); fflush(stdout);
+ // ESC 8 Restore Cursor (DECRC), VT100.
+ print("\x1b" "8"); fflush(stdout);
}
void move_cursor(char c)
@@ -155,7 +159,7 @@ void move_cursor(T_cursor_movement_direction d)
{
// already at the end of buffer
if (buffer_index_cursor == line_buffer.size()) break;
-
+
buffer_index_cursor++;
_buffer_index_display_begin++;
print_override(line_buffer);