gnu: rxvt-unicode: Fix the cursor position when opening new windows in 9.31.
Fixes <https://issues.guix.gnu.org/64719>. * gnu/packages/patches/rxvt-unicode-fix-cursor-position.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/xdisorg.scm (rxvt-unicode)[source]: Use it.
This commit is contained in:
		
							parent
							
								
									8d19ff2305
								
							
						
					
					
						commit
						8b8607a945
					
				
					 3 changed files with 81 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -1926,6 +1926,7 @@ dist_patch_DATA =						\
 | 
			
		|||
  %D%/packages/patches/rust-webbrowser-remove-unsupported-os.patch	\
 | 
			
		||||
  %D%/packages/patches/rust-wl-clipboard-rs-newer-wl.patch      \
 | 
			
		||||
  %D%/packages/patches/rw-igraph-0.10.patch			\
 | 
			
		||||
  %D%/packages/patches/rxvt-unicode-fix-cursor-position.patch	\
 | 
			
		||||
  %D%/packages/patches/sbc-fix-build-non-x86.patch		\
 | 
			
		||||
  %D%/packages/patches/sbcl-aserve-add-HTML-5-elements.patch	\
 | 
			
		||||
  %D%/packages/patches/sbcl-aserve-fix-rfe12668.patch	\
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										79
									
								
								gnu/packages/patches/rxvt-unicode-fix-cursor-position.patch
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								gnu/packages/patches/rxvt-unicode-fix-cursor-position.patch
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,79 @@
 | 
			
		|||
Fix a bug that causes the cursor position to be incorrect when opening
 | 
			
		||||
new terminals:
 | 
			
		||||
 | 
			
		||||
http://lists.schmorp.de/pipermail/rxvt-unicode/2023q1/002639.html
 | 
			
		||||
https://bugs.archlinux.org/task/77062
 | 
			
		||||
https://gitlab.alpinelinux.org/alpine/aports/-/issues/14525
 | 
			
		||||
 | 
			
		||||
This patches reverts all changes made to 'src/screen.C' in rxvt-unicode 9.31.
 | 
			
		||||
 | 
			
		||||
--- rxvt-unicode-9.31/src/screen.C	2022-08-08 06:33:08.000000000 -0400
 | 
			
		||||
+++ rxvt-unicode-9.30/src/screen.C	2021-07-02 23:55:47.000000000 -0400
 | 
			
		||||
@@ -293,7 +293,6 @@
 | 
			
		||||
 
 | 
			
		||||
       int common_col = min (prev_ncol, ncol);
 | 
			
		||||
 
 | 
			
		||||
-      // resize swap_buf, blank drawn_buf
 | 
			
		||||
       for (int row = min (nrow, prev_nrow); row--; )
 | 
			
		||||
         {
 | 
			
		||||
           scr_blank_screen_mem (drawn_buf [row], DEFAULT_RSTYLE);
 | 
			
		||||
@@ -307,7 +306,6 @@
 | 
			
		||||
       int pend = MOD (term_start + top_row  , prev_total_rows);
 | 
			
		||||
       int q    = total_rows; // rewrapped row
 | 
			
		||||
 
 | 
			
		||||
-#if ENABLE_FRILLS
 | 
			
		||||
       if ((rewrap_always || top_row) && !rewrap_never)
 | 
			
		||||
         {
 | 
			
		||||
           // Re-wrap lines. This is rather ugly, possibly because I am too dumb
 | 
			
		||||
@@ -389,35 +387,36 @@
 | 
			
		||||
               scr_blank_line (*qline, qline->l, ncol - qline->l, DEFAULT_RSTYLE);
 | 
			
		||||
             }
 | 
			
		||||
           while (p != pend && q > 0);
 | 
			
		||||
+
 | 
			
		||||
+          term_start = total_rows - nrow;
 | 
			
		||||
+          top_row = q - term_start;
 | 
			
		||||
+
 | 
			
		||||
+          // make sure all terminal lines exist
 | 
			
		||||
+          while (top_row > 0)
 | 
			
		||||
+            scr_blank_screen_mem (ROW (--top_row), DEFAULT_RSTYLE);
 | 
			
		||||
         }
 | 
			
		||||
       else
 | 
			
		||||
-#endif
 | 
			
		||||
         {
 | 
			
		||||
-          // wing, instead of wrap
 | 
			
		||||
-          screen.cur.row += nrow - prev_nrow;
 | 
			
		||||
+          // if no scrollback exists (yet), wing, instead of wrap
 | 
			
		||||
 
 | 
			
		||||
-          do
 | 
			
		||||
+          for (int row = min (nrow, prev_nrow); row--; )
 | 
			
		||||
             {
 | 
			
		||||
-              p = MOD (p - 1, prev_total_rows);
 | 
			
		||||
-              q--;
 | 
			
		||||
+              line_t &src = prev_row_buf [MOD (term_start + row, prev_total_rows)];
 | 
			
		||||
+              line_t &dst = row_buf [row];
 | 
			
		||||
 
 | 
			
		||||
-              copy_line (row_buf [q], prev_row_buf [p]);
 | 
			
		||||
+              copy_line (dst, src);
 | 
			
		||||
             }
 | 
			
		||||
-          while (p != pend && q > 0);
 | 
			
		||||
-        }
 | 
			
		||||
 
 | 
			
		||||
-      term_start = total_rows - nrow;
 | 
			
		||||
-      top_row = q - term_start;
 | 
			
		||||
+          for (int row = prev_nrow; row < nrow; row++)
 | 
			
		||||
+            scr_blank_screen_mem (row_buf [row], DEFAULT_RSTYLE);
 | 
			
		||||
 
 | 
			
		||||
-      // make sure all terminal lines exist
 | 
			
		||||
-      while (top_row > 0)
 | 
			
		||||
-        scr_blank_screen_mem (ROW (--top_row), DEFAULT_RSTYLE);
 | 
			
		||||
+          term_start = 0;
 | 
			
		||||
+        }
 | 
			
		||||
 
 | 
			
		||||
       clamp_it (screen.cur.row, 0, nrow - 1);
 | 
			
		||||
       clamp_it (screen.cur.col, 0, ncol - 1);
 | 
			
		||||
     }
 | 
			
		||||
 
 | 
			
		||||
-  // ensure drawn_buf, swap_buf and terminal rows are all initialized
 | 
			
		||||
   for (int row = nrow; row--; )
 | 
			
		||||
     {
 | 
			
		||||
       if (!ROW       (row).valid ()) scr_blank_screen_mem (ROW       (row), DEFAULT_RSTYLE);
 | 
			
		||||
| 
						 | 
				
			
			@ -1335,6 +1335,7 @@ compact configuration syntax.")
 | 
			
		|||
              (method url-fetch)
 | 
			
		||||
              (uri (string-append "http://dist.schmorp.de/rxvt-unicode/Attic/"
 | 
			
		||||
                                  name "-" version ".tar.bz2"))
 | 
			
		||||
              (patches (search-patches "rxvt-unicode-fix-cursor-position.patch"))
 | 
			
		||||
              (sha256
 | 
			
		||||
               (base32
 | 
			
		||||
                "1s3jcvac40zzp03fvmhjsdpsjx0gb1wk54qz74zhzzj9q75kz8da"))))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue