terminal/kitty-gfx: do not send response on transmit/display unless I

This commit is contained in:
Mitchell Hashimoto
2023-08-23 22:37:01 -07:00
parent 35f1a9a478
commit ec5dcf0850
2 changed files with 7 additions and 2 deletions

View File

@ -146,6 +146,10 @@ fn transmit(
// After the image is added, set the ID in case it changed // After the image is added, set the ID in case it changed
result.id = load.image.id; result.id = load.image.id;
// If the original request had an image number, then we respond.
// Otherwise, we don't respond.
if (load.image.number == 0) return .{};
return result; return result;
} }
@ -228,7 +232,8 @@ fn display(
}, },
} }
return result; // Display does not result in a response on success
return .{};
} }
/// Display a previously transmitted image. /// Display a previously transmitted image.

View File

@ -1115,7 +1115,7 @@ const StreamHandler = struct {
try resp.encode(buf_stream.writer()); try resp.encode(buf_stream.writer());
const final = buf_stream.getWritten(); const final = buf_stream.getWritten();
if (final.len > 2) { if (final.len > 2) {
//log.warn("kitty graphics response: {s}", .{final[1 .. final.len - 1]}); // log.warn("kitty graphics response: {s}", .{std.fmt.fmtSliceHexLower(final)});
self.messageWriter(try termio.Message.writeReq(self.alloc, final)); self.messageWriter(try termio.Message.writeReq(self.alloc, final));
} }
} }