Skip to content

Commit d10681f

Browse files
committed
Send responses when only a number and no id is specified
1 parent e96ff19 commit d10681f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

kitty/graphics.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,14 +520,15 @@ finish_command_response(const GraphicsCommand *g, bool data_loaded, uint32_t iid
520520
if (g->quiet) {
521521
if (is_ok_response || g->quiet > 1) return NULL;
522522
}
523-
if (iid) {
523+
if (iid || image_number) {
524524
if (is_ok_response) {
525525
if (!data_loaded) return NULL;
526526
snprintf(command_response, 10, "OK");
527527
}
528528
size_t pos = 0;
529+
rbuf[pos++] = 'G';
529530
#define print(fmt, ...) pos += snprintf(rbuf + pos, arraysz(rbuf) - 1 - pos, fmt, __VA_ARGS__)
530-
print("Gi=%u", iid);
531+
if (iid) print("i=%u", iid);
531532
if (image_number) print(",I=%u", image_number);
532533
if (placement_id) print(",p=%u", placement_id);
533534
print(";%s", command_response);

kitty_tests/graphics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ def put(**kw):
277277

278278
code, idstr = put(c=2, r=2, I=93)
279279
self.ae((code, idstr), ('OK', 'i=6,I=93'))
280-
self.assertIsNone(put(c=2, r=2, I=94))
280+
code, idstr = put(c=2, r=2, I=94)
281+
self.ae(code, 'ENOENT')
281282

282283
def test_image_put(self):
283284
cw, ch = 10, 20

0 commit comments

Comments
 (0)