summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2025-02-24 12:30:36 +0000
committerFelix Fietkau2025-02-24 12:31:53 +0000
commit15c27ce9f0a86635ec336c89fcb11c1d02e46613 (patch)
tree5e0f89990fb0572d0814ae14bc2bd4a00581543d
parent06c6481e7fedeaea316823f93d3a918200fb8ed4 (diff)
downloadopenwrt-15c27ce9f0a86635ec336c89fcb11c1d02e46613.tar.gz
ucode-mod-uline: fix prompt after set_hint with string bigger than the window size
Redraw the prompt after the hint instead of trying to move backwards Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--package/utils/ucode-mod-uline/src/uline.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/package/utils/ucode-mod-uline/src/uline.c b/package/utils/ucode-mod-uline/src/uline.c
index 4bee2597c3..26cea6fa24 100644
--- a/package/utils/ucode-mod-uline/src/uline.c
+++ b/package/utils/ucode-mod-uline/src/uline.c
@@ -880,7 +880,14 @@ void uline_set_hint(struct uline_state *s, const char *str, size_t len)
pos_add_string(s, &s->cursor_pos, str, len);
}
- set_cursor(s, prev_pos);
+ if (s->cursor_pos.y >= s->rows) {
+ if (s->cursor_pos.x > 0)
+ vt100_next_line(s->output);
+ s->cursor_pos = (struct pos){};
+ s->full_update = true;
+ } else {
+ set_cursor(s, prev_pos);
+ }
fflush(s->output);
}