File altscreen_backport.diff of Package screen.18256

--- ./ansi.c.orig	2019-04-25 13:30:16.863901370 +0000
+++ ./ansi.c	2019-04-25 13:31:36.851707881 +0000
@@ -1437,13 +1437,18 @@ int c, intermediate;
 		  if (i)
 		    {
 		      if (!curr->w_alt.on)
-			SaveCursor(&curr->w_alt.cursor);
-		      EnterAltScreen(curr);
+			{
+			  SaveCursor(&curr->w_alt.cursor);
+			  EnterAltScreen(curr);
+			}
 		    }
 		  else
 		    {
-		      LeaveAltScreen(curr);
-		      RestoreCursor(&curr->w_alt.cursor);
+		      if (curr->w_alt.on)
+			{
+			  RestoreCursor(&curr->w_alt.cursor);
+			  LeaveAltScreen(curr);
+			}
 		    }
 		  if (a1 == 47 && !i)
 		    curr->w_saved.on = 0;
openSUSE Build Service is sponsored by