--- rxvt-unicode/src/command.C 2005/06/18 09:02:37 1.203 +++ rxvt-unicode/src/command.C 2005/07/13 02:47:02 1.204 @@ -2648,6 +2648,7 @@ bool refreshnow = false; int nlines = 0; unicode_t *str = buf; + unicode_t *eol = str + min (TermWin.ncol, UBUFSIZ); for (;;) { @@ -2656,7 +2657,7 @@ *str++ = ch; - if (ch == C0_LF) + if (ch == C0_LF || str >= eol) { nlines++; refresh_count++; @@ -2675,13 +2676,20 @@ scr_add_lines (buf, nlines, str - buf); nlines = 0; str = buf; + eol = str + min (TermWin.ncol, UBUFSIZ); + } + + if (str >= eol) + { + if (eol >= buf + UBUFSIZ) + { + ch = NOCHAR; + break; + } + else + eol = min (eol + TermWin.ncol, buf + UBUFSIZ); } - } - if (str >= buf + UBUFSIZ) - { - ch = NOCHAR; - break; } seq_begin = cmdbuf_ptr;