MCPcopy
hub / github.com/kovidgoyal/kitty / client_request_data

Function client_request_data

kitty_tests/dnd.py:66–76  ·  view source on GitHub ↗

Escape code a client sends to request data (t=r:x=idx) or finish the drop (t=r with no x). *idx*: 1-based index into the list of MIME types. 0 or omitted means finish.

(idx: int = 0, client_id: int = 0)

Source from the content-addressed store, hash-verified

64
65
66def client_request_data(idx: int = 0, client_id: int = 0) -> bytes:
67 """Escape code a client sends to request data (t=r:x=idx) or finish the drop (t=r with no x).
68
69 *idx*: 1-based index into the list of MIME types. 0 or omitted means finish.
70 """
71 meta = f'{DND_CODE};t=r'
72 if idx > 0:
73 meta += f':x={idx}'
74 if client_id:
75 meta += f':i={client_id}'
76 return _osc(meta)
77
78
79def client_request_uri_data(mime_idx: int, file_idx: int, client_id: int = 0) -> bytes:

Calls 1

_oscFunction · 0.85