-/* $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>
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);