From 800437ec6bb7ca1e6011a8a88525efd3eaf57885 Mon Sep 17 00:00:00 2001 From: pagedown Date: Wed, 24 Aug 2022 15:14:53 +0800 Subject: [PATCH] Remote control: Add --no-response to some commands --- kitty/rc/close_tab.py | 8 ++++++++ kitty/rc/close_window.py | 8 ++++++++ kitty/rc/scroll_window.py | 9 ++++++++- kitty/rc/signal_child.py | 8 +++++++- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/kitty/rc/close_tab.py b/kitty/rc/close_tab.py index 52cd9612c..ed31ccdf8 100644 --- a/kitty/rc/close_tab.py +++ b/kitty/rc/close_tab.py @@ -17,6 +17,7 @@ class CloseTab(RemoteCommand): ''' match/str: Which tab to close + no_response/bool: Boolean indicating whether to wait for a response self/bool: Boolean indicating whether to close the tab of the window the command is run in ''' @@ -29,6 +30,13 @@ tabs in the currently focused OS window, use:: kitty @ close-tab --match "not state:focused and state:parent_focused" ''' options_spec = MATCH_TAB_OPTION + '''\n +--no-response +type=bool-set +default=false +Don't wait for a response indicating the success of the action. Note that +using this option means that you will not be notified of failures. + + --self type=bool-set Close the tab of the window this command is run in, rather than the active tab. diff --git a/kitty/rc/close_window.py b/kitty/rc/close_window.py index e57564d07..ebc1b0a7e 100644 --- a/kitty/rc/close_window.py +++ b/kitty/rc/close_window.py @@ -16,11 +16,19 @@ if TYPE_CHECKING: class CloseWindow(RemoteCommand): ''' match/str: Which window to close + no_response/bool: Boolean indicating whether to wait for a response self/bool: Boolean indicating whether to close the window the command is run in ''' short_desc = 'Close the specified windows' options_spec = MATCH_WINDOW_OPTION + '''\n +--no-response +type=bool-set +default=false +Don't wait for a response indicating the success of the action. Note that +using this option means that you will not be notified of failures. + + --self type=bool-set Close the window this command is run in, rather than the active window. diff --git a/kitty/rc/scroll_window.py b/kitty/rc/scroll_window.py index dcd5f5ab9..b473dde05 100644 --- a/kitty/rc/scroll_window.py +++ b/kitty/rc/scroll_window.py @@ -21,6 +21,7 @@ class ScrollWindow(RemoteCommand): And the second item being either 'p' for pages or 'l' for lines or 'u' for unscrolling by lines. match/str: The window to scroll + no_response/bool: Boolean indicating whether to wait for a response ''' short_desc = 'Scroll the specified windows' @@ -32,7 +33,13 @@ class ScrollWindow(RemoteCommand): ' scrollback buffer onto the top of the screen.' ) argspec = 'SCROLL_AMOUNT' - options_spec = MATCH_WINDOW_OPTION + options_spec = MATCH_WINDOW_OPTION + '''\n +--no-response +type=bool-set +default=false +Don't wait for a response indicating the success of the action. Note that +using this option means that you will not be notified of failures. +''' def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType: if len(args) < 1: diff --git a/kitty/rc/signal_child.py b/kitty/rc/signal_child.py index 908a52e17..a199d2240 100644 --- a/kitty/rc/signal_child.py +++ b/kitty/rc/signal_child.py @@ -17,6 +17,7 @@ class SignalChild(RemoteCommand): ''' signals/list.str: The signals, a list of names, such as :code:`SIGTERM`, :code:`SIGKILL`, :code:`SIGUSR1`, etc. match/str: Which windows to send the signals to + no_response/bool: Boolean indicating whether to wait for a response ''' short_desc = 'Send a signal to the foreground process in the specified windows' @@ -25,10 +26,15 @@ class SignalChild(RemoteCommand): ' If you use the :option:`kitty @ signal-child --match` option' ' the signal will be sent for all matched windows. By default, only the active' ' window is affected. If you do not specify any signals, :code:`SIGINT` is sent by default.' - ' You can also map this to a shortcut in :file:`kitty.conf`, for example::\n\n' + ' You can also map :ac:`signal_child` to a shortcut in :file:`kitty.conf`, for example::\n\n' ' map f1 signal_child SIGTERM' ) options_spec = '''\ +--no-response +type=bool-set +default=false +Don't wait for a response indicating the success of the action. Note that +using this option means that you will not be notified of failures. ''' + '\n\n' + MATCH_WINDOW_OPTION argspec = '[SIGNAL_NAME ...]'