From eeddda57ff458cc0a8f5dac932fa10ed2fb767f7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 20 Aug 2023 14:48:42 -0700 Subject: [PATCH] terminal/kitty-gfx: handle quiet settings for response --- src/terminal/kitty/graphics_exec.zig | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/terminal/kitty/graphics_exec.zig b/src/terminal/kitty/graphics_exec.zig index be62cd20e..0cb77a9a0 100644 --- a/src/terminal/kitty/graphics_exec.zig +++ b/src/terminal/kitty/graphics_exec.zig @@ -24,10 +24,22 @@ pub fn execute( ) ?Response { _ = terminal; _ = buf; - switch (cmd.control) { - .query => return query(alloc, cmd), - else => return .{ .message = "ERROR: unimplemented action" }, + + const resp_: ?Response = switch (cmd.control) { + .query => query(alloc, cmd), + else => .{ .message = "ERROR: unimplemented action" }, + }; + + // Handle the quiet settings + if (resp_) |resp| { + return switch (cmd.quiet) { + .no => resp, + .ok => if (resp.ok()) null else resp, + .failures => null, + }; } + + return null; } /// Execute a "query" command.