rxvt-unicode-9.14-clear.patch 937 B

1234567891011121314151617181920212223242526
  1. store visible lines to buffer before clearing the screen when pressing ctrl-l
  2. patch by rlblaster
  3. https://bbs.archlinux.org/viewtopic.php?id=129302
  4. --- a/src/command.C
  5. +++ b/src/command.C
  6. @@ -2932,6 +2932,17 @@
  7. case CSI_CUP: /* 8.3.21: (1,1) CURSOR POSITION */
  8. case CSI_HVP: /* 8.3.64: (1,1) CHARACTER AND LINE POSITION */
  9. + if (nargs == 1 && current_screen == 0)
  10. + {
  11. + // This is usually followed with clear screen so add some extra
  12. + // lines to avoid deleting the lines already on screen. If we are
  13. + // already at the top, add an extra screen height of lines.
  14. + int extra_lines = nrow-1;
  15. + if (screen.cur.row == 0)
  16. + extra_lines += nrow;
  17. + for (int i = 0; i < extra_lines; ++i)
  18. + scr_add_lines (L"\r\n", 2);
  19. + }
  20. scr_gotorc (arg[0] - 1, nargs < 2 ? 0 : (arg[1] - 1), 0);
  21. break;