From 6f20e4b0b9e07c8e3b694092d751c08f4cff564d Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Tue, 12 May 2026 10:13:53 +0700 Subject: [PATCH] Fix cursor position overwritten by addstr after loop --- scripts/tui.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/tui.py b/scripts/tui.py index f13505d..fcd93d2 100644 --- a/scripts/tui.py +++ b/scripts/tui.py @@ -166,6 +166,7 @@ class HendrikTUI: else: show = self.input_line - 1 + cursor_yx = None for i in range(2): idx = show + i y = iy + 1 + i @@ -182,8 +183,10 @@ class HendrikTUI: except curses.error: pass if idx == self.input_line and not self.processing: - col = 4 + min(self.input_col, max_text) - stdscr.move(y, col) + cursor_yx = (y, 4 + min(self.input_col, max_text)) + + if cursor_yx: + stdscr.move(*cursor_yx) # ---- status bar -------------------------------------------------------