From 315562d73d5d7f6c77dc5c3092557918e4e30170 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 3 Sep 2025 21:46:47 +0530 Subject: [PATCH] Cleanup previous PR --- docs/changelog.rst | 3 +++ kitty/options/definition.py | 2 +- kitty/window.py | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 9be526fe0..c3dfbd716 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -165,6 +165,9 @@ Detailed list of changes - Wayland: Update bundled copy of libwayland to 1.24 from 1.23.1 because the just released mesa 25.2.0 breaks with libwayland < 1.24 (:iss:`8884`) +- macOS: Pass the :kbd:`Cmd+C` shortcut to the application running in the + terminal when no text is selected (:pull:`8946`) + 0.42.2 [2025-07-16] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/options/definition.py b/kitty/options/definition.py index ad47c44b6..7eb1247a9 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -3726,7 +3726,7 @@ to :kbd:`Ctrl+C`. It will copy only if there is a selection and send an interrupt otherwise. Similarly, :ac:`copy_and_clear_or_interrupt` will copy and clear the selection or send an interrupt if there is no selection. The :ac:`copy_or_noop` action will copy if there is a selection and pass -the key through to the application if there is no selection. +the key through to the application running in the terminal if there is no selection. ''' ) map('Copy to clipboard or pass through', diff --git a/kitty/window.py b/kitty/window.py index f879d8086..df4c67f41 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -2142,14 +2142,14 @@ class Window: self.scroll_end() self.write_to_child(self.encoded_key(KeyEvent(key=ord('c'), mods=GLFW_MOD_CONTROL))) - @ac('cp', 'Copy the selected text from the active window to the clipboard, if no selection, pass the key through to the application') + @ac('cp', 'Copy the selected text from the active window to the clipboard, if no selection,' + ' pass the key through to the application running in the terminal.') def copy_or_noop(self) -> bool: text = self.text_for_selection() if text: set_clipboard_string(text) return False - else: - return True + return True @ac('cp', 'Copy the selected text from the active window to the clipboard and clear selection, if no selection, send SIGINT (aka :kbd:`ctrl+c`)') def copy_and_clear_or_interrupt(self) -> None: