From 3e8e51525a38ce67bd7b622ed8b281a853c51687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 7 Mar 2021 14:19:44 +0100 Subject: [PATCH] =?UTF-8?q?sixel:=20don=E2=80=99t=20emit=20DECGNL=20after?= =?UTF-8?q?=20the=20last=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Emitting DECGNL is the sixel equivalent of printing ā€˜\nā€™, and can cause the terminal content to scroll. --- src/lib/sixel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/sixel.c b/src/lib/sixel.c index e0079f933..54c32e59b 100644 --- a/src/lib/sixel.c +++ b/src/lib/sixel.c @@ -194,7 +194,9 @@ write_sixel_data(FILE* fp, int lenx, sixeltable* stab){ if(i + 1 < stab->ctab->colors){ fputc('$', fp); }else{ - fputc('-', fp); + if(p + lenx < stab->ctab->sixelcount){ + fputc('-', fp); + } } } p += lenx;