You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/graphics-protocol.rst
+39-5Lines changed: 39 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -359,9 +359,8 @@ second one will replace the first. This can be used to resize or move
359
359
placements around the screen, without flicker.
360
360
361
361
362
-
.. note:: Support for specifying placement ids was added to kitty in
363
-
versions after 0.19.2. You can use the protocol documented in the
364
-
:doc:`kittens/query_terminal` to query kitty version.
362
+
.. versionadded:: 0.19.3
363
+
Support for specifying placement ids (see :doc:`kittens/query_terminal` to query kitty version)
365
364
366
365
367
366
Controlling displayed image layout
@@ -415,7 +414,9 @@ Value of ``d`` Meaning
415
414
================= ============
416
415
``a`` or ``A`` Delete all placements visible on screen
417
416
``i`` or ``I`` Delete all images with the specified id, specified using the ``i`` key. If you specify a ``p`` key for the placement id as well, then only the placement with the specified image id and placement id will be deleted.
418
-
placement id
417
+
``n`` or ``N`` Delete newest image with the specified number, specified using the ``I`` key. If you specify a ``p`` key for the
418
+
placement id as well, then only the placement with the specified number and placement id will be deleted.
419
+
``c`` or ``C`` Delete all placements that intersect with the current cursor position.
419
420
``c`` or ``C`` Delete all placements that intersect with the current cursor position.
420
421
``p`` or ``P`` Delete all placements that intersect a specific cell, the cell is specified using the ``x`` and ``y`` keys
421
422
``q`` or ``Q`` Delete all placements that intersect a specific cell having a specific z-index. The cell and z-index is specified using the ``x``, ``y`` and ``z`` keys.
@@ -447,7 +448,40 @@ script, it might be useful to avoid having to process responses from the
447
448
terminal. For this, you can use the ``q`` key. Set it to ``1`` to suppress
448
449
``OK`` responses and to ``2`` to suppress failure responses.
449
450
450
-
.. note:: This feature was implemented in kitty in versions after 0.19.2
451
+
.. versionadded:: 0.19.3
452
+
The ability to suppress responses (see :doc:`kittens/query_terminal` to query kitty version)
453
+
454
+
455
+
Requesting image ids from the terminal
456
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
457
+
458
+
If you are writing a program that is going to share the screen with other
459
+
programs and you still want to use image ids, it is not possible to know
460
+
what image ids are free to use. In this case, instead of using the ``i``
461
+
key to specify and image id use the ``I`` key to specify and image number
462
+
instead. These numbers are not unique.
463
+
When creating a new image, even if an existing image has the same number a new
464
+
one is created. And the terminal will reply with the id of the newly created
465
+
image. For example, when creating an image with ``I=13``, the terminal will
466
+
send the response::
467
+
468
+
<ESC>_Gi=99,I=13;OK<ESC>\
469
+
470
+
Here, the value of ``i`` is the id for the newly created image and the value of
471
+
``I`` is the same as was sent in the creation command.
472
+
473
+
All future commands that refer to images using the image number, such as
474
+
creating placements or deleting images, will act on only the newest image with
475
+
that number. This allows the client program to send a bunch of commands dealing
476
+
with an image by image number without waiting for a response from the terminal
477
+
with the image id. Once such a response is received, the client program should
478
+
use the ``i`` key with the image id for all future communication.
479
+
480
+
.. note:: Specifying both ``i`` and ``I`` keys in any command is an error. The
481
+
terminal must reply with an EINVAL error message, unless silenced.
482
+
483
+
.. versionadded:: 0.19.3
484
+
The ability to use image numbers (see :doc:`kittens/query_terminal` to query kitty version)
if (img==NULL) { set_command_failed_response("ENOENT", "Put command refers to non-existent image with id: %u", g->id); return; }
528
-
if (!img->data_loaded) { set_command_failed_response("ENOENT", "Put command refers to image with id: %u that could not load its data", g->id); return; }
if (img==NULL) { set_command_failed_response("ENOENT", "Put command refers to non-existent image with id: %u and number: %u", g->id, g->image_number); return0; }
577
+
}
578
+
if (!img->data_loaded) { set_command_failed_response("ENOENT", "Put command refers to image with id: %u that could not load its data", g->id); return0; }
0 commit comments