From f3e98fb72b6bf12f0c7029993fd37ee1137edcec Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 21 Aug 2026 06:30:35 -0700 Subject: [PATCH] terminal/kitty: X handling properly since 0.45 fix --- src/terminal/kitty/graphics_command.zig | 10 ++-------- src/terminal/kitty/graphics_exec.zig | 11 ----------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/terminal/kitty/graphics_command.zig b/src/terminal/kitty/graphics_command.zig index c8a9f14a2..e57ad174f 100644 --- a/src/terminal/kitty/graphics_command.zig +++ b/src/terminal/kitty/graphics_command.zig @@ -783,7 +783,7 @@ pub const AnimationFrameLoading = struct { /// leaves the gap unchanged. gap_ms: i32 = 0, // z - composition_mode: CompositionMode = .alpha_blend, // X (or C, see parse) + composition_mode: CompositionMode = .alpha_blend, // X background: Background = .{}, // Y /// The canvas background color as a 32-bit RGBA value where R is @@ -825,16 +825,10 @@ pub const AnimationFrameLoading = struct { result.gap_ms = @bitCast(v); } - // The published spec assigns the composition mode to the X - // key and Kitty honored that through 0.44; Kitty 0.45 moved - // it to the C key (a doc/implementation regression). We accept - // either, tested only against 1 like Kitty. + // Tested only against 1 like Kitty. if (kv.get('X')) |v| { result.composition_mode = if (v == 1) .overwrite else .alpha_blend; } - if (kv.get('C')) |v| { - if (v == 1) result.composition_mode = .overwrite; - } if (kv.get('Y')) |v| { result.background = @bitCast(v); diff --git a/src/terminal/kitty/graphics_exec.zig b/src/terminal/kitty/graphics_exec.zig index cc47afd84..b1b968b28 100644 --- a/src/terminal/kitty/graphics_exec.zig +++ b/src/terminal/kitty/graphics_exec.zig @@ -2852,19 +2852,8 @@ test "kittygfx animation: create from base frame with overwrite" { try testing.expect(resp.ok()); } - // Kitty >= 0.45 uses C for the same flag; accept it too. - { - const cmd = try command.Parser.parseString( - alloc, - "a=f,i=1,f=32,s=1,v=1,c=1,C=1;AAD/gA==", - ); - defer cmd.deinit(alloc); - try testing.expect(execute(io, alloc, &t, &cmd).?.ok()); - } - const anim = storage.imagePtrByIdOrNumber(1, 0).?.animation.?; try testing.expectEqualSlices(u8, &.{ 0, 0, 255, 128 }, anim.frames.items[0].data); - try testing.expectEqualSlices(u8, &.{ 0, 0, 255, 128 }, anim.frames.items[1].data); } test "kittygfx animation: alpha blend composes over base frame" {