@@ -25,7 +25,7 @@ Only the first chunk is guaranteed to have metadata other than the ``m`` key.
2525Subsequent chunks may optionally omit all
2626metadata except the ``m `` and ``i `` keys. While a chunked transfer is in
2727progress it is a protocol error to for the sending side to
28- send any protocol related escape codes other than chunked ones.
28+ send any protocol related escape codes other than chunked ones or query (`` t=q|Q ``) ones .
2929In particular, this means that the receiving side should use the metadata from
3030the first chunk in a chain of chunks only.
3131
@@ -438,6 +438,31 @@ inform the client of it with::
438438The error code for too many resources is ``EMFILE `` for IO errors is ``EIO ``
439439and so on.
440440
441+ Detecting support for this protocol
442+ -------------------------------------
443+
444+ Clients can query the terminal emulator for support of this protocol
445+ using::
446+
447+ OSC _dnd_code ; t=q:i=optional ST
448+ OSC _dnd_code ; t=Q:i=optional ST
449+
450+ The former queries support for drag and the latter for drop. The ``i `` key is
451+ optional, if present it will be echoed back in the responses from the terminal.
452+ A terminal supporting this protocol **must ** respond with::
453+
454+ OSC _dnd_code ; t=q:i=echoed ; payload ST
455+ OSC _dnd_code ; t=Q:i=echoed ; payload ST
456+
457+ Here, ``payload `` is a colon separated list of ``key=value `` pairs. These
458+ specify support for optional/future parts of this protocol. Currently the
459+ payload is empty, but that might change as the protocol evolves.
460+
461+ The client should send these escape codes followed by a request for the `primary device
462+ attributes <https://vt100.net/docs/vt510-rm/DA1.html> `_. If a response for the
463+ device attributes is received before a response for the queries, then the
464+ terminal does not support this protocol.
465+
441466Multiplexers
442467-----------------
443468
@@ -469,6 +494,8 @@ Key Value Default Description
469494 ``e `` - a drag offer event occurred
470495 ``E `` - a drag offer data error occurred
471496 ``k `` - data for uri-list items in drag offer
497+ ``q `` - query support for drag
498+ ``Q `` - query support for drop
472499
473500``m`` Chunking indicator ``0`` ``0`` or ``1``
474501
0 commit comments