Check scroll-on-clear for ED also.
authornicm <nicm@openbsd.org>
Thu, 17 Mar 2022 13:39:13 +0000 (13:39 +0000)
committernicm <nicm@openbsd.org>
Thu, 17 Mar 2022 13:39:13 +0000 (13:39 +0000)
usr.bin/tmux/screen-write.c

index 367759d..6339a9e 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-write.c,v 1.206 2022/03/17 11:35:37 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.207 2022/03/17 13:39:13 nicm Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1479,7 +1479,9 @@ screen_write_clearscreen(struct screen_write_ctx *ctx, u_int bg)
        ttyctx.bg = bg;
 
        /* Scroll into history if it is enabled. */
-       if (s->grid->flags & GRID_HISTORY)
+       if ((s->grid->flags & GRID_HISTORY) &&
+           ctx->wp != NULL &&
+           options_get_number(ctx->wp->options, "scroll-on-clear"))
                grid_view_clear_history(s->grid, bg);
        else
                grid_view_clear(s->grid, 0, 0, sx, sy, bg);