diff --git a/docs/changelog.rst b/docs/changelog.rst index 5c1ba8c..c1fdd9a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -222,6 +222,11 @@ Detailed list of changes 0.50.1 [unreleased] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +- 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 ` in a left dock by default, instead of requiring a manual mapping. This takes the key over from :ac:`open_url`; remap diff --git a/docs/clipboard.rst b/docs/clipboard.rst index 7f64957..33a3a64 100644 --- a/docs/clipboard.rst +++ b/docs/clipboard.rst @@ -264,3 +264,30 @@ 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 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. + +To bind both actions, add something like this to :file:`kitty.conf`: + +.. code-block:: conf + + map kitty_mod+shift+v paste_from_clipboard_history + map kitty_mod+shift+f 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.