From 480645877a680a560c20f34bb4b93dbd029cb956 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 5 Oct 2017 23:01:47 +0530 Subject: [PATCH] Clear graphics when switching to the alternate screen buffer --- graphics-protocol.asciidoc | 11 +++++++++++ kitty/screen.c | 1 + 2 files changed, 12 insertions(+) diff --git a/graphics-protocol.asciidoc b/graphics-protocol.asciidoc index d71dc015d..331dc1380 100644 --- a/graphics-protocol.asciidoc +++ b/graphics-protocol.asciidoc @@ -266,3 +266,14 @@ take, and the default value they take when missing. All integers are 32-bit. | `r` | Positive integer | `0` | The number of rows to display the image over | `z` | Integer | `0` | The *z-index* vertical stacking order of the image |=== + + +== Interaction with screen changes + +When resetting the screen, all images that are visible on the screen must be +cleared. When switching from the main screen to the alternate screen buffer +(1049 private mode) all images in the alternate screen must be cleared, just as +all text is cleared. + +The commands to clear the screen and erase text must have no effect on +graphics. The dedicated delete graphics commands must be used for those. diff --git a/kitty/screen.c b/kitty/screen.c index e35bc10f9..f6a42e3ad 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -436,6 +436,7 @@ screen_toggle_screen_buffer(Screen *self) { bool to_alt = self->linebuf == self->main_linebuf; if (to_alt) { linebuf_clear(self->alt_linebuf, BLANK_CHAR); + grman_clear(self->alt_grman); screen_save_cursor(self); self->linebuf = self->alt_linebuf; self->tabstops = self->alt_tabstops;