From b93767b54fd55112ea091f0c906c9fc7089f263f Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 29 Jun 2017 21:33:29 +0200
Subject: [PATCH] screen: defeat a VTE/Konsole bug also for the case of
 --constantshow

When also --nohelp is active and the terminal is so narrow that the
message that --constantshow displays on the bottom row does not fit,
this causes the cursor to be pushed "offscreen".  Some terminal
emulators don't handle this case correctly, and leave the cursor
in an invisible or mistaken position.  Compensate for this by
moving the cursor back to the start of the row.

This fixes https://savannah.gnu.org/bugs/?51335.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
---
 src/winio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/winio.c b/src/winio.c
index 0a8700f9..37d752f4 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2162,6 +2162,10 @@ void statusline(message_type importance, const char *msg, ...)
 	waddstr(bottomwin, " ]");
     wattroff(bottomwin, interface_color_pair[STATUS_BAR]);
 
+    /* Defeat a VTE/Konsole bug, where the cursor can go off-limits. */
+    if (ISSET(CONSTANT_SHOW) && ISSET(NO_HELP))
+	wmove(bottomwin, 0, 0);
+
     /* Push the message to the screen straightaway. */
     wrefresh(bottomwin);
 
-- 
GitLab