Resizing the terminal cuts off output
Bert Münnich
ber.t at posteo.de
Thu Oct 22 17:00:30 CEST 2015
On 20.10.15, Marc Lehmann wrote:
> On Tue, Oct 20, 2015 at 06:00:19PM +0200, STaRDoGG CHaMP <stardoggchamp at googlemail.com> wrote:
> > when I resize a urxvt terminal window, it cuts off the output of the terminal
> > if the borders overlap with its content. I made a video demonstrating this [1].
> > In the video I use i3 and I have already asked the i3 guys [2], but they told
>
> This works as designed - you have to have some scrollback active for this
> to work like in xterm (just output a few more empty lines for example), or
> configure your prompt to redraw differently on resize.
I fixed the behaviour from the video a while ago, but forgot to send the
patch to the mail list. All the patch does is scrolling the lines in the
terminal when the window height gets smaller in order to keep the line
with the cursor visible. This does not affect the re-wrapping as it is
only done if the scrollback buffer is empty.
Enjoy,
Bert
-------------- next part --------------
--- a/src/screen.C 2013-02-10 20:33:45.131543378 +0100
+++ b/src/screen.C 2013-02-10 20:32:16.168690241 +0100
@@ -398,9 +398,17 @@ rxvt_term::scr_reset ()
{
// if no scrollback exists (yet), wing, instead of wrap
+ int nrow_scroll = 0;
+
+ if (nrow <= screen.cur.row)
+ {
+ nrow_scroll = screen.cur.row + 1 - nrow;
+ want_refresh = 1;
+ }
+
for (int row = min (nrow, prev_nrow); row--; )
{
- line_t &src = prev_row_buf [MOD (term_start + row, prev_total_rows)];
+ line_t &src = prev_row_buf [MOD (term_start + row + nrow_scroll, prev_total_rows)];
line_t &dst = row_buf [row];
copy_line (dst, src);
More information about the rxvt-unicode
mailing list