mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 17:52:02 +02:00
Graphics protocol: Allow suppressing responses from the terminal to graphics commands
This commit is contained in:
@@ -135,6 +135,7 @@ class TestGraphics(BaseTest):
|
||||
|
||||
# Test load query
|
||||
self.ae(l('abcd', s=1, v=1, a='q'), 'OK')
|
||||
self.assertIsNone(l('abcd', s=1, v=1, a='q', q=1))
|
||||
self.ae(g.image_count, 0)
|
||||
|
||||
# Test simple load
|
||||
@@ -150,6 +151,8 @@ class TestGraphics(BaseTest):
|
||||
self.ae(l('mnop', m=0), 'OK')
|
||||
img = g.image_for_client_id(1)
|
||||
self.ae(img['data'], b'abcdefghijklmnop')
|
||||
self.ae(l('abcd', s=10, v=10, q=1), 'ENODATA:Insufficient image data: 4 < 400')
|
||||
self.ae(l('abcd', s=10, v=10, q=2), None)
|
||||
|
||||
# Test compression
|
||||
random_data = byte_block(3 * 1024)
|
||||
|
||||
@@ -379,7 +379,7 @@ class TestParser(BaseTest):
|
||||
for f in 'action delete_action transmission_type compressed'.split():
|
||||
k.setdefault(f, b'\0')
|
||||
for f in ('format more id data_sz data_offset width height x_offset y_offset data_height data_width'
|
||||
' num_cells num_lines cell_x_offset cell_y_offset z_index placement_id').split():
|
||||
' num_cells num_lines cell_x_offset cell_y_offset z_index placement_id quiet').split():
|
||||
k.setdefault(f, 0)
|
||||
p = k.pop('payload', '').encode('utf-8')
|
||||
k['payload_sz'] = len(p)
|
||||
@@ -400,7 +400,7 @@ class TestParser(BaseTest):
|
||||
pb('\033_Gi=12\033\\', c(id=12))
|
||||
t('a=t,t=d,s=100,z=-9', payload='X', action='t', transmission_type='d', data_width=100, z_index=-9, payload_sz=1)
|
||||
t('a=t,t=d,s=100,z=9', payload='payload', action='t', transmission_type='d', data_width=100, z_index=9, payload_sz=7)
|
||||
t('a=t,t=d,s=100,z=9', action='t', transmission_type='d', data_width=100, z_index=9)
|
||||
t('a=t,t=d,s=100,z=9,q=2', action='t', transmission_type='d', data_width=100, z_index=9, quiet=2)
|
||||
e(',s=1', 'Malformed GraphicsCommand control block, invalid key character: 0x2c')
|
||||
e('W=1', 'Malformed GraphicsCommand control block, invalid key character: 0x57')
|
||||
e('1=1', 'Malformed GraphicsCommand control block, invalid key character: 0x31')
|
||||
|
||||
Reference in New Issue
Block a user