From 04218bb87748b9011df1c2c9bb54cf08aaba7068 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 12 Nov 2020 10:01:33 -0800 Subject: [PATCH] termwiz: fixup sixel width calculation @yoichi reports that: ```bash printf "\x1bPqh" ``` would panic wezterm; the issue was that the maximum x value was only being updated for newlines and that sequence didn't include it. refs: #217 --- termwiz/src/escape/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/termwiz/src/escape/mod.rs b/termwiz/src/escape/mod.rs index 52364592f..074d5312c 100644 --- a/termwiz/src/escape/mod.rs +++ b/termwiz/src/escape/mod.rs @@ -235,11 +235,13 @@ impl Sixel { match d { SixelData::Data(_) => { max_y = max_y.max(rows * 6); - x += 1 + x += 1; + max_x = max_x.max(x); } SixelData::Repeat { repeat_count, .. } => { max_y = max_y.max(rows * 6); - x += repeat_count + x += repeat_count; + max_x = max_x.max(x); } SixelData::SelectColorMapEntry(_) | SixelData::DefineColorMapRGB { .. }