From 5ea9700c8287da242a10a3eb92ca42fe41a4d431 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 18 Oct 2023 20:40:39 +0530 Subject: [PATCH] More kitty @ -> kitten @ --- docs/conf.py | 12 ++++++------ docs/glossary.rst | 2 +- docs/kittens/custom.rst | 2 +- docs/remote-control.rst | 4 ++-- kitty/cli.py | 8 ++++---- kitty/launch.py | 5 ++--- kitty/rc/base.py | 6 +++--- kitty/rc/close_tab.py | 2 +- kitty/rc/detach_tab.py | 2 +- kitty/rc/detach_window.py | 2 +- kitty/rc/launch.py | 4 ++-- kitty/rc/new_window.py | 4 ++-- kitty/rc/send_text.py | 2 +- kitty/rc/set_background_opacity.py | 2 +- kitty/rc/set_colors.py | 4 ++-- kitty/rc/set_font_size.py | 2 +- kitty/rc/set_tab_title.py | 2 +- kitty/rc/set_user_vars.py | 2 +- kitty/rc/set_window_title.py | 2 +- kitty/rc/signal_child.py | 2 +- kitty/remote_control.py | 4 ++-- 21 files changed, 37 insertions(+), 38 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 95e9f1407..dd6fdb34f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -251,20 +251,20 @@ if you specify a program-to-run you can use the special placeholder as_rst = partial(option_spec_as_rst, heading_char='_') from kitty.rc.base import all_command_names, command_for_name from kitty.remote_control import cli_msg, global_options_spec - with open('generated/cli-kitty-at.rst', 'w') as f: + with open('generated/cli-kitten-at.rst', 'w') as f: p = partial(print, file=f) - p('kitty @') + p('kitten @') p('-' * 80) - p('.. program::', 'kitty @') + p('.. program::', 'kitten @') p('\n\n' + as_rst( - global_options_spec, message=cli_msg, usage='command ...', appname='kitty @')) + global_options_spec, message=cli_msg, usage='command ...', appname='kitten @')) from kitty.rc.base import cli_params_for for cmd_name in sorted(all_command_names()): func = command_for_name(cmd_name) p(f'.. _at-{func.name}:\n') - p('kitty @', func.name) + p('kitten @', func.name) p('-' * 120) - p('.. program::', 'kitty @', func.name) + p('.. program::', 'kitten @', func.name) p('\n\n' + as_rst(*cli_params_for(func))) from kittens.runner import get_kitten_cli_docs diff --git a/docs/glossary.rst b/docs/glossary.rst index 8575bba0e..77437b696 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -179,7 +179,7 @@ Variables that kitty sets when running child programs Set when the :doc:`remote control ` facility is enabled and the a socket is used for control via :option:`kitty --listen-on` or :opt:`listen_on`. - Contains the path to the socket. Avoid the need to use :option:`kitty @ --to` when + Contains the path to the socket. Avoid the need to use :option:`kitten @ --to` when issuing remote control commands. Can also be a file descriptor of the form fd:num instead of a socket address, in which case, remote control communication should proceed over the specified file descriptor. diff --git a/docs/kittens/custom.rst b/docs/kittens/custom.rst index 415268327..0387957b7 100644 --- a/docs/kittens/custom.rst +++ b/docs/kittens/custom.rst @@ -56,7 +56,7 @@ Kittens have full access to internal kitty APIs. However these are neither entirely stable nor documented. You can instead use the kitty :doc:`Remote control API `. Simply call :code:`boss.call_remote_control()`, with the same arguments you -would pass to ``kitty @``. For example: +would pass to ``kitten @``. For example: .. code-block:: python diff --git a/docs/remote-control.rst b/docs/remote-control.rst index 469aef3aa..8f936ec37 100644 --- a/docs/remote-control.rst +++ b/docs/remote-control.rst @@ -330,7 +330,7 @@ Matching windows and tabs Many remote control operations operate on windows or tabs. To select these, the :code:`--match` option is often used. This allows matching using various -sophisticated criteria such as title, ids, cmdlines, etc. These criteria are +sophisticated criteria such as title, ids, command lines, etc. These criteria are expressions of the form :code:`field:query`. Where :italic:`field` is the field against which to match and :italic:`query` is the expression to match. They can be further combined using Boolean operators, best illustrated with some @@ -346,4 +346,4 @@ examples:: rc_protocol -.. include:: generated/cli-kitty-at.rst +.. include:: generated/cli-kitten-at.rst diff --git a/kitty/cli.py b/kitty/cli.py index f91c95f80..d4192af27 100644 --- a/kitty/cli.py +++ b/kitty/cli.py @@ -943,10 +943,10 @@ Listen on the specified socket address for control messages. For example, UNIX sockets, not associated with a file, like this: :option:`{appname} --listen-on`=unix:@mykitty. Environment variables are expanded and relative paths are resolved with respect to the temporary directory. To control kitty, -you can send commands to it with :italic:`{appname} @` using the -:option:`{appname} @ --to` option to specify this address. Note that if you run -:italic:`{appname} @` within a kitty window, there is no need to specify the -:option:`{appname} @ --to` option as it will automatically read from the +you can send commands to it with :italic:`kitten @` using the +:option:`kitten @ --to` option to specify this address. Note that if you run +:italic:`kitten @` within a kitty window, there is no need to specify the +:option:`kitten @ --to` option as it will automatically read from the environment. Note that this will be ignored unless :opt:`allow_remote_control` is set to either: :code:`yes`, :code:`socket` or :code:`socket-only`. This can also be specified in :file:`kitty.conf`. diff --git a/kitty/launch.py b/kitty/launch.py index 08a8d9c0b..a6a514d87 100644 --- a/kitty/launch.py +++ b/kitty/launch.py @@ -72,7 +72,7 @@ Where to launch the child process: :code:`background` The process will be run in the :italic:`background`, without a kitty - window. Note that if :option:`kitty @ launch --allow-remote-control` is + window. Note that if :option:`kitten @ launch --allow-remote-control` is specified the :envvar:`KITTY_LISTEN_ON` environment variable will be set to a dedicated socket pair file descriptor that the process can use for remote control. @@ -140,8 +140,7 @@ Copy the environment variables from the currently active window into the newly launched child process. Note that this only copies the environment when the window was first created, as it is not possible to get updated environment variables from arbitrary processes. To copy that environment, use either the :ref:`clone-in-kitty -` feature or the kitty remote control feature with :option:`kitty -@ launch --copy-env`. +` feature or the kitty remote control feature with :option:`kitten @ launch --copy-env`. --location diff --git a/kitty/rc/base.py b/kitty/rc/base.py index 09af9ed16..334022d2e 100644 --- a/kitty/rc/base.py +++ b/kitty/rc/base.py @@ -94,7 +94,7 @@ a number, not a regular expression. Negative values for :code:`id` match from th -1 is the most recently created window. The field :code:`num` refers to the window position in the current tab, starting from zero and counting clockwise (this -is the same as the order in which the windows are reported by the :ref:`kitty @ ls ` command). +is the same as the order in which the windows are reported by the :ref:`kitten @ ls ` command). The window id of the current window is available as the :envvar:`KITTY_WINDOW_ID` environment variable. @@ -121,7 +121,7 @@ remote control command is run. The value :code:`overlay_parent` matches the window that is under the :code:`self` window, when the self window is an overlay. -Note that you can use the :ref:`kitty @ ls ` command to get a list of windows. +Note that you can use the :ref:`kitten @ ls ` command to get a list of windows. ''' MATCH_TAB_OPTION = '''\ --match -m @@ -156,7 +156,7 @@ The field :code:`state` matches on the state of the tab. Supported states are: Active tabs are the tabs that are active in their parent OS window. There is only one focused tab and it is the tab to which keyboard events are delivered. If no tab is focused, the last focused tab is matched. -Note that you can use the :ref:`kitty @ ls ` command to get a list of tabs. +Note that you can use the :ref:`kitten @ ls ` command to get a list of tabs. ''' diff --git a/kitty/rc/close_tab.py b/kitty/rc/close_tab.py index c4315b248..6aae21bc4 100644 --- a/kitty/rc/close_tab.py +++ b/kitty/rc/close_tab.py @@ -24,7 +24,7 @@ Close an arbitrary set of tabs. The :code:`--match` option can be used to specify complex sets of tabs to close. For example, to close all non-focused tabs in the currently focused OS window, use:: - kitty @ close-tab --match "not state:focused and state:parent_focused" + kitten @ close-tab --match "not state:focused and state:parent_focused" ''' options_spec = MATCH_TAB_OPTION + '''\n --no-response diff --git a/kitty/rc/detach_tab.py b/kitty/rc/detach_tab.py index 53b7025d0..ca2d84781 100644 --- a/kitty/rc/detach_tab.py +++ b/kitty/rc/detach_tab.py @@ -20,7 +20,7 @@ class DetachTab(RemoteCommand): short_desc = 'Detach the specified tabs and place them in a different/new OS window' desc = ( 'Detach the specified tabs and either move them into a new OS window' - ' or add them to the OS window containing the tab specified by :option:`kitty @ detach-tab --target-tab`' + ' or add them to the OS window containing the tab specified by :option:`kitten @ detach-tab --target-tab`' ) options_spec = MATCH_TAB_OPTION + '\n\n' + MATCH_TAB_OPTION.replace('--match -m', '--target-tab -t') + '''\n --self diff --git a/kitty/rc/detach_window.py b/kitty/rc/detach_window.py index f0a59c8c1..2d518373d 100644 --- a/kitty/rc/detach_window.py +++ b/kitty/rc/detach_window.py @@ -20,7 +20,7 @@ class DetachWindow(RemoteCommand): short_desc = 'Detach the specified windows and place them in a different/new tab' desc = ( 'Detach the specified windows and either move them into a new tab, a new OS window' - ' or add them to the specified tab. Use the special value :code:`new` for :option:`kitty @ detach-window --target-tab`' + ' or add them to the specified tab. Use the special value :code:`new` for :option:`kitten @ detach-window --target-tab`' ' to move to a new tab. If no target tab is specified the windows are moved to a new OS window.' ) options_spec = ( diff --git a/kitty/rc/launch.py b/kitty/rc/launch.py index 0dd16795a..66b297bed 100644 --- a/kitty/rc/launch.py +++ b/kitty/rc/launch.py @@ -57,7 +57,7 @@ class Launch(RemoteCommand): 'Prints out the id of the newly opened window. Any command line arguments' ' are assumed to be the command line used to run in the new window, if none' ' are provided, the default shell is run. For example::\n\n' - ' kitty @ launch --title=Email mutt' + ' kitten @ launch --title=Email mutt' ) options_spec = MATCH_TAB_OPTION + '\n\n' + '''\ --no-response @@ -69,7 +69,7 @@ Do not print out the id of the newly created window. type=bool-set If specified the tab containing the window this command is run in is used instead of the active tab - ''' + '\n\n' + launch_options_spec().replace(':option:`launch', ':option:`kitty @ launch') + ''' + '\n\n' + launch_options_spec().replace(':option:`launch', ':option:`kitten @ launch') args = RemoteCommand.Args(spec='[CMD ...]', json_field='args', completion=RemoteCommand.CompletionSpec.from_string( 'type:special group:cli.CompleteExecutableFirstArg')) diff --git a/kitty/rc/new_window.py b/kitty/rc/new_window.py index 2a0ea2cb5..3ddfa57ac 100644 --- a/kitty/rc/new_window.py +++ b/kitty/rc/new_window.py @@ -25,13 +25,13 @@ class NewWindow(RemoteCommand): short_desc = 'Open new window' desc = ( 'DEPRECATED: Use the :ref:`launch ` command instead.\n\n' - 'Open a new window in the specified tab. If you use the :option:`kitty @ new-window --match` option' + 'Open a new window in the specified tab. If you use the :option:`kitten @ new-window --match` option' ' the first matching tab is used. Otherwise the currently active tab is used.' ' Prints out the id of the newly opened window' ' (unless :option:`--no-response` is used). Any command line arguments' ' are assumed to be the command line used to run in the new window, if none' ' are provided, the default shell is run. For example::\n\n' - ' kitty @ new-window --title Email mutt' + ' kitten @ new-window --title Email mutt' ) options_spec = MATCH_TAB_OPTION + '''\n --title diff --git a/kitty/rc/send_text.py b/kitty/rc/send_text.py index 91eb848d2..793050f73 100644 --- a/kitty/rc/send_text.py +++ b/kitty/rc/send_text.py @@ -87,7 +87,7 @@ class SendText(RemoteCommand): ' escaping rules. So you can use :link:`escapes `' " like :code:`'\\\\e'` to send control codes" " and :code:`'\\\\u21fa'` to send Unicode characters. Remember to use single-quotes otherwise" - ' the backslash is interpreted as a shell escape character. If you use the :option:`kitty @ send-text --match` option' + ' the backslash is interpreted as a shell escape character. If you use the :option:`kitten @ send-text --match` option' ' the text will be sent to all matched windows. By default, text is sent to' ' only the currently active window.' ) diff --git a/kitty/rc/set_background_opacity.py b/kitty/rc/set_background_opacity.py index dfaf9b6b1..3ebfdf4c2 100644 --- a/kitty/rc/set_background_opacity.py +++ b/kitty/rc/set_background_opacity.py @@ -37,7 +37,7 @@ class SetBackgroundOpacity(RemoteCommand): 'Set the background opacity for the specified windows. This will only work if you have turned on' ' :opt:`dynamic_background_opacity` in :file:`kitty.conf`. The background opacity affects all kitty windows in a' ' single OS window. For example::\n\n' - ' kitty @ set-background-opacity 0.5' + ' kitten @ set-background-opacity 0.5' ) options_spec = '''\ --all -a diff --git a/kitty/rc/set_colors.py b/kitty/rc/set_colors.py index 4367b74b9..5a62f0dfe 100644 --- a/kitty/rc/set_colors.py +++ b/kitty/rc/set_colors.py @@ -78,7 +78,7 @@ class SetColors(RemoteCommand): ' You can either specify the path to a conf file' ' (in the same format as :file:`kitty.conf`) to read the colors from or you can specify individual colors,' ' for example::\n\n' - ' kitty @ set-colors foreground=red background=white' + ' kitten @ set-colors foreground=red background=white' ) options_spec = '''\ --all -a @@ -96,7 +96,7 @@ windows or after a reset). --reset type=bool-set Restore all colors to the values they had at kitty startup. Note that if you specify -this option, any color arguments are ignored and :option:`kitty @ set-colors --configured` and :option:`kitty @ set-colors --all` are implied. +this option, any color arguments are ignored and :option:`kitten @ set-colors --configured` and :option:`kitten @ set-colors --all` are implied. ''' + '\n\n' + MATCH_WINDOW_OPTION + '\n\n' + MATCH_TAB_OPTION.replace('--match -m', '--match-tab -t') args = RemoteCommand.Args(spec='COLOR_OR_FILE ...', json_field='colors', special_parse='parse_colors_and_files(args)', completion=RemoteCommand.CompletionSpec.from_string('type:file group:"CONF files", ext:conf')) diff --git a/kitty/rc/set_font_size.py b/kitty/rc/set_font_size.py index 5d14a65ec..464527824 100644 --- a/kitty/rc/set_font_size.py +++ b/kitty/rc/set_font_size.py @@ -24,7 +24,7 @@ class SetFontSize(RemoteCommand): ' resets the font size to default. Prefixing the value' ' with a :code:`+` or :code:`-` increments the font size by the specified' ' amount. Use -- before using - to have it not mistaken for a option. For example:' - ' kitty @ set-font-size -- -2' + ' kitten @ set-font-size -- -2' ) args = RemoteCommand.Args(spec='FONT_SIZE', count=1, special_parse='+increment_op:parse_set_font_size(args[0], &payload)', json_field='size') options_spec = '''\ diff --git a/kitty/rc/set_tab_title.py b/kitty/rc/set_tab_title.py index 52895efcc..1bd57c1c2 100644 --- a/kitty/rc/set_tab_title.py +++ b/kitty/rc/set_tab_title.py @@ -19,7 +19,7 @@ class SetTabTitle(RemoteCommand): short_desc = 'Set the tab title' desc = ( - 'Set the title for the specified tabs. If you use the :option:`kitty @ set-tab-title --match` option' + 'Set the title for the specified tabs. If you use the :option:`kitten @ set-tab-title --match` option' ' the title will be set for all matched tabs. By default, only the tab' ' in which the command is run is affected. If you do not specify a title, the' ' title of the currently active window in the tab is used.' diff --git a/kitty/rc/set_user_vars.py b/kitty/rc/set_user_vars.py index deb9296f2..e45538233 100644 --- a/kitty/rc/set_user_vars.py +++ b/kitty/rc/set_user_vars.py @@ -18,7 +18,7 @@ class SetUserVars(RemoteCommand): short_desc = 'Set user variables on a window' desc = ( - 'Set user variables for the specified windows. If you use the :option:`kitty @ set-window-title --match` option' + 'Set user variables for the specified windows. If you use the :option:`kitten @ set-user-vars --match` option' ' the variables will be set for all matched windows. By default, only the window' ' in which the command is run is affected. If you do not specify any variables, the' ' current variables are printed out, one per line. To unset a variable specify just its name.' diff --git a/kitty/rc/set_window_title.py b/kitty/rc/set_window_title.py index 1683be412..b0df22ccc 100644 --- a/kitty/rc/set_window_title.py +++ b/kitty/rc/set_window_title.py @@ -19,7 +19,7 @@ class SetWindowTitle(RemoteCommand): short_desc = 'Set the window title' desc = ( - 'Set the title for the specified windows. If you use the :option:`kitty @ set-window-title --match` option' + 'Set the title for the specified windows. If you use the :option:`kitten @ set-window-title --match` option' ' the title will be set for all matched windows. By default, only the window' ' in which the command is run is affected. If you do not specify a title, the' ' last title set by the child process running in the window will be used.' diff --git a/kitty/rc/signal_child.py b/kitty/rc/signal_child.py index b601f57c1..280a086aa 100644 --- a/kitty/rc/signal_child.py +++ b/kitty/rc/signal_child.py @@ -19,7 +19,7 @@ class SignalChild(RemoteCommand): short_desc = 'Send a signal to the foreground process in the specified windows' desc = ( 'Send one or more signals to the foreground process in the specified windows.' - ' If you use the :option:`kitty @ signal-child --match` option' + ' If you use the :option:`kitten @ 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 :ac:`signal_child` to a shortcut in :file:`kitty.conf`, for example::\n\n' diff --git a/kitty/remote_control.py b/kitty/remote_control.py index 813fa9696..683220700 100644 --- a/kitty/remote_control.py +++ b/kitty/remote_control.py @@ -279,14 +279,14 @@ completion=type:file relative:conf kwds:- default=rc-pass A file from which to read the password. Trailing whitespace is ignored. Relative paths are resolved from the kitty configuration directory. Use - to read from STDIN. -Used if no :option:`kitty @ --password` is supplied. Defaults to checking for the +Used if no :option:`kitten @ --password` is supplied. Defaults to checking for the :file:`rc-pass` file in the kitty configuration directory. --password-env default=KITTY_RC_PASSWORD The name of an environment variable to read the password from. -Used if no :option:`kitty @ --password-file` is supplied. Defaults +Used if no :option:`kitten @ --password-file` is supplied. Defaults to checking the environment variable :envvar:`KITTY_RC_PASSWORD`.