Merge branch 'feat/clipboard-history'

Keep an in-memory history of copied text, browsable and searchable from
keyboard shortcuts, without writing anything to disk.
This commit is contained in:
BlackAngelTV committed 2026-11-12 07:27:57 +01:00
commit 263607ab47
10 files changed
+385 -9

No files matched your search

+5
View File
@@ -232,6 +232,11 @@ Detailed list of changes
that ends a command without reporting a status (:code:`OSC 133;D` with no
argument) now shows :code:`0` instead of an empty status.
- kitty now keeps an in-memory history of the text copied to the clipboard,
which :ac:`paste_from_clipboard_history` and :ac:`search_clipboard_history`
can paste back. Nothing is written to disk and private clipboard writes are
never recorded. See :ref:`clipboard_history` for details.
- :kbd:`Ctrl+Shift+E` now opens the :doc:`file manager kitten
<kittens/file-manager>` in a left dock by default, instead of requiring a
manual mapping. This takes the key over from :ac:`open_url`; remap
+32
View File
@@ -264,3 +264,35 @@ to access the clipboard.
When the terminal sends an unsolicited paste event because the user triggered
a paste and the 5522 mode is enabled, there will be no associated id. In this
case, the multiplexer must forward the event to the currently active window.
.. _clipboard_history:
Clipboard history
---------------------
kitty keeps the last 50 pieces of plain text copied to the clipboard of each
instance, newest first, and lets you paste one of them back with
:ac:`paste_from_clipboard_history`. :ac:`search_clipboard_history` filters the
history with a fuzzy query before showing the list.
The picker numbers the entries: type the number next to the entry you want to
paste, or press :kbd:`Escape` to cancel.
The history lives in memory only: it is never written to disk, so it disappears
when kitty exits and secrets copied during a session do not outlive it. Text
written by a program that marks its request as private (by passing a ``pw``
field in an *OSC 5522* write request) is never recorded, and neither is anything
copied to the primary selection. Images and other non-text data are ignored.
Both actions have a default shortcut: :kbd:`kitty_mod+alt+v` opens the
history and :kbd:`kitty_mod+alt+f` asks for a fuzzy query before showing the
list. To use different keys, add for example to :file:`kitty.conf`:
.. code-block:: conf
map kitty_mod+alt+h paste_from_clipboard_history
map kitty_mod+alt+g search_clipboard_history
The size of the history is fixed at 50 entries, 64 KiB per entry and 1 MiB in
total, so that a few large copies cannot use an unbounded amount of memory.