summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/screen-write.c b/screen-write.c
index 0d70f668..aa898f78 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1427,7 +1427,11 @@ screen_write_clearendofscreen(struct screen_write_ctx *ctx, u_int bg)
ttyctx.bg = bg;
/* Scroll into history if it is enabled and clearing entire screen. */
- if (s->cx == 0 && s->cy == 0 && (gd->flags & GRID_HISTORY))
+ if (s->cx == 0 &&
+ s->cy == 0 &&
+ (gd->flags & GRID_HISTORY) &&
+ ctx->wp != NULL &&
+ options_get_number(ctx->wp->options, "scroll-on-clear"))
grid_view_clear_history(gd, bg);
else {
if (s->cx <= sx - 1)