Merge branch 'rc-no-response' of https://github.com/page-down/kitty

This commit is contained in:
Kovid Goyal
2022-08-24 14:15:13 +05:30
4 changed files with 31 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ class CloseTab(RemoteCommand):
''' '''
match/str: Which tab to close 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 self/bool: Boolean indicating whether to close the tab of the window the command is run in
ignore_no_match/bool: Boolean indicating whether no matches should be ignored or return an error ignore_no_match/bool: Boolean indicating whether no matches should be ignored or return an error
''' '''
@@ -30,6 +31,13 @@ tabs in the currently focused OS window, use::
kitty @ close-tab --match "not state:focused and state:parent_focused" kitty @ close-tab --match "not state:focused and state:parent_focused"
''' '''
options_spec = MATCH_TAB_OPTION + '''\n 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 --self
type=bool-set type=bool-set
Close the tab of the window this command is run in, rather than the active tab. Close the tab of the window this command is run in, rather than the active tab.

View File

@@ -16,12 +16,20 @@ if TYPE_CHECKING:
class CloseWindow(RemoteCommand): class CloseWindow(RemoteCommand):
''' '''
match/str: Which window to close 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 self/bool: Boolean indicating whether to close the window the command is run in
ignore_no_match/bool: Boolean indicating whether no matches should be ignored or return an error ignore_no_match/bool: Boolean indicating whether no matches should be ignored or return an error
''' '''
short_desc = 'Close the specified windows' short_desc = 'Close the specified windows'
options_spec = MATCH_WINDOW_OPTION + '''\n 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 --self
type=bool-set type=bool-set
Close the window this command is run in, rather than the active window. Close the window this command is run in, rather than the active window.

View File

@@ -21,6 +21,7 @@ class ScrollWindow(RemoteCommand):
And the second item being either 'p' for pages or 'l' for lines or 'u' And the second item being either 'p' for pages or 'l' for lines or 'u'
for unscrolling by lines. for unscrolling by lines.
match/str: The window to scroll match/str: The window to scroll
no_response/bool: Boolean indicating whether to wait for a response
''' '''
short_desc = 'Scroll the specified windows' short_desc = 'Scroll the specified windows'
@@ -32,7 +33,13 @@ class ScrollWindow(RemoteCommand):
' scrollback buffer onto the top of the screen.' ' scrollback buffer onto the top of the screen.'
) )
argspec = 'SCROLL_AMOUNT' 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: def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
if len(args) < 1: if len(args) < 1:

View File

@@ -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. 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 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' 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' ' If you use the :option:`kitty @ signal-child --match` option'
' the signal will be sent for all matched windows. By default, only the active' ' 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.' ' 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' ' map f1 signal_child SIGTERM'
) )
options_spec = '''\ 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 ''' + '\n\n' + MATCH_WINDOW_OPTION
argspec = '[SIGNAL_NAME ...]' argspec = '[SIGNAL_NAME ...]'