mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-27 03:42:49 +00:00
Send responses when only a number and no id is specified
This commit is contained in:
parent
e96ff19a7a
commit
d10681f27f
2 changed files with 5 additions and 3 deletions
|
|
@ -520,14 +520,15 @@ finish_command_response(const GraphicsCommand *g, bool data_loaded, uint32_t iid
|
|||
if (g->quiet) {
|
||||
if (is_ok_response || g->quiet > 1) return NULL;
|
||||
}
|
||||
if (iid) {
|
||||
if (iid || image_number) {
|
||||
if (is_ok_response) {
|
||||
if (!data_loaded) return NULL;
|
||||
snprintf(command_response, 10, "OK");
|
||||
}
|
||||
size_t pos = 0;
|
||||
rbuf[pos++] = 'G';
|
||||
#define print(fmt, ...) pos += snprintf(rbuf + pos, arraysz(rbuf) - 1 - pos, fmt, __VA_ARGS__)
|
||||
print("Gi=%u", iid);
|
||||
if (iid) print("i=%u", iid);
|
||||
if (image_number) print(",I=%u", image_number);
|
||||
if (placement_id) print(",p=%u", placement_id);
|
||||
print(";%s", command_response);
|
||||
|
|
|
|||
|
|
@ -277,7 +277,8 @@ class TestGraphics(BaseTest):
|
|||
|
||||
code, idstr = put(c=2, r=2, I=93)
|
||||
self.ae((code, idstr), ('OK', 'i=6,I=93'))
|
||||
self.assertIsNone(put(c=2, r=2, I=94))
|
||||
code, idstr = put(c=2, r=2, I=94)
|
||||
self.ae(code, 'ENOENT')
|
||||
|
||||
def test_image_put(self):
|
||||
cw, ch = 10, 20
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue