From 5c0d477a18bc01d69cea1c1f843674ddd4d1e6db Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 1 Feb 2023 10:49:58 +0530 Subject: [PATCH] icat kitten: Fix transmission of frame data in direct mode Sometimes frame data is > 2048 but does not compress smaller, which broke the if statement checking for first loop. Fixes #5958 --- docs/changelog.rst | 3 +++ tools/tui/graphics/command.go | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 218ad44cb..cd8dcec8b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -43,6 +43,9 @@ Detailed list of changes - Fix a regression causing the ``edit-in-kitty`` command not working if :file:`kitten` is not added to PATH (:iss:`5956`) +- icat kitten: Fix a regression that broke display of animated GIFs over SSH + (:iss:`5958`) + 0.27.0 [2023-01-31] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tools/tui/graphics/command.go b/tools/tui/graphics/command.go index 56ff52115..82ee0259b 100644 --- a/tools/tui/graphics/command.go +++ b/tools/tui/graphics/command.go @@ -551,6 +551,7 @@ func (self *GraphicsCommand) WriteWithPayloadTo(o io.StringWriter, payload []byt payload = compressed } data := base64.StdEncoding.EncodeToString(payload) + is_first := true for len(data) > 0 && err == nil { chunk := data if len(data) > 4096 { @@ -565,9 +566,10 @@ func (self *GraphicsCommand) WriteWithPayloadTo(o io.StringWriter, payload []byt gc.m = GRT_more_nomore } err = gc.serialize_to(o, chunk) - if gc.DataSize() > 0 { + if !is_first { gc = GraphicsCommand{} } + is_first = false } return }