--- rxvt-unicode/src/screen.C 2005/12/22 15:52:57 1.190 +++ rxvt-unicode/src/screen.C 2005/12/22 19:25:58 1.192 @@ -285,7 +285,7 @@ row_col_t ocur = screen.cur; ocur.row = MOD (term_start + ocur.row, prev_total_rows); - while (p != pend && q > 0) + do { p = MOD (p - 1, prev_total_rows); #ifdef DEBUG_STRICT @@ -331,10 +331,12 @@ prow = MOD (p + prow, prev_total_rows); - // we only adjust the cursor _row_, as this seems to upset - // applications/shells/readline least. + // we only adjust the cursor _row_ and put it into + // the topmost line of "long line" it was in, as + // this seems to upset applications/shells/readline + // least. if (prow == ocur.row) - screen.cur.row = qrow - (total_rows - nrow); + screen.cur.row = q - (total_rows - nrow); line_t &pline = old_buf [prow]; @@ -354,9 +356,9 @@ qline->l = llen < ncol ? llen : MOD (llen - 1, ncol) + 1; scr_blank_line (*qline, qline->l, ncol - qline->l, DEFAULT_RSTYLE); } + while (p != pend && q > 0); term_start = total_rows - nrow; - view_start = 0; nsaved = term_start - q; // make sure all terminal lines exist @@ -383,7 +385,6 @@ } term_start = 0; - view_start = 0; } #ifdef DEBUG_STRICT