From 02f1fec497b0aa247f124a9ad2cd37e4ee3c824c Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 3 Jan 2021 13:52:31 +0100 Subject: [PATCH] prompt: restore a workaround for a cursor misplacement bug in ncurses When making small movements in the lower right corner, ncurses can get confused about where the cursor actually is -- a double-width character seems to throw its calculations off. This addresses https://savannah.gnu.org/bugs/?59808. Bug existed since version 5.4, commit 39705c60. --- src/prompt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/prompt.c b/src/prompt.c index 6f26a171..b1786263 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -407,6 +407,12 @@ void draw_the_promptbar(void) wattroff(bottomwin, interface_color_pair[PROMPT_BAR]); + /* Work around a cursor-misplacement bug -- https://sv.gnu.org/bugs/?59808. */ + if (ISSET(NO_HELP)) { + wmove(bottomwin, 0, 0); + wrefresh(bottomwin); + } + /* Place the cursor at the right spot. */ column = base + wideness(answer, typing_x); wmove(bottomwin, 0, column - get_statusbar_page_start(base, column));