kitty @
--------------------------------------------------------------------------------
.. program:: kitty @


.. highlight:: sh
.. code-block:: sh

  kitty @ [options] command ...

Control kitty by sending it commands. Set the :opt:`allow_remote_control` option to yes in :file:`kitty.conf` for this to work.

Options
______________________________
.. option:: --to <TO>

    An address for the kitty instance to control. Corresponds to the address given to the kitty instance via the :option:`kitty --listen-on` option. If not specified, messages are sent to the controlling terminal for this process, i.e. they will only work if this process is run within an existing kitty window.

.. _at_close-tab:

kitty @ close-tab
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ close-tab


.. highlight:: sh
.. code-block:: sh

  kitty @ close-tab [options] 

Close the specified tab(s)

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. option:: --self

    If specified close the tab this command is run in, rather than the active tab.

.. _at_close-window:

kitty @ close-window
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ close-window


.. highlight:: sh
.. code-block:: sh

  kitty @ close-window [options] 

Close the specified window(s)

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --self

    If specified close the window this command is run in, rather than the active window.

.. _at_create-marker:

kitty @ create-marker
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ create-marker


.. highlight:: sh
.. code-block:: sh

  kitty @ create-marker [options] MARKER SPECIFICATION

Create a marker which can highlight text in the specified window. For example: create_marker text 1 ERROR. For full details see: https://sw.kovidgoyal.net/kitty/marks.html

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --self

    If specified apply marker to the window this command is run in, rather than the active window.

.. _at_detach-tab:

kitty @ detach-tab
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ detach-tab


.. highlight:: sh
.. code-block:: sh

  kitty @ detach-tab [options] 

Detach the specified tab and either move it into a new OS window or add it to the OS Window containing the tab specified by --target-tab

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. option:: --target-tab <TARGET_TAB>, -t <TARGET_TAB>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. option:: --self

    If specified detach the tab this command is run in, rather than the active tab.

.. _at_detach-window:

kitty @ detach-window
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ detach-window


.. highlight:: sh
.. code-block:: sh

  kitty @ detach-window [options] 

Detach the specified window and either move it into a new tab, a new OS window or add it to the specified tab. Use the special value :code:`new` for --target-tab to move to a new tab. If no target tab is specified the window is moved to a new OS window.

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --target-tab <TARGET_TAB>, -t <TARGET_TAB>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. option:: --self

    If specified detach the window this command is run in, rather than the active window.

.. _at_disable-ligatures:

kitty @ disable-ligatures
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ disable-ligatures


.. highlight:: sh
.. code-block:: sh

  kitty @ disable-ligatures [options] STRATEGY

Control ligature rendering for the specified windows/tabs (defaults to active window). The STRATEGY can be one of: never, always, cursor

Options
______________________________
.. option:: --all, -a

    By default, ligatures are only affected in the active window. This option will cause ligatures to be changed in all windows.

.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --match-tab <MATCH_TAB>, -t <MATCH_TAB>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. _at_focus-tab:

kitty @ focus-tab
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ focus-tab


.. highlight:: sh
.. code-block:: sh

  kitty @ focus-tab [options] 

The active window in the specified tab will be focused.

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. option:: --no-response

    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.
    Default: :code:`false`

.. _at_focus-window:

kitty @ focus-window
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ focus-window


.. highlight:: sh
.. code-block:: sh

  kitty @ focus-window [options] 

Focus the specified window, if no window is specified, focus the window this command is run inside.

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --no-response

    Don't wait for a response from kitty. This means that even if no matching window is found, the command will exit with a success code.
    Default: :code:`false`

.. _at_get-colors:

kitty @ get-colors
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ get-colors


.. highlight:: sh
.. code-block:: sh

  kitty @ get-colors [options] ...

Get the terminal colors for the specified window (defaults to active window). Colors will be output to stdout in the same syntax as used for kitty.conf

Options
______________________________
.. option:: --configured, -c

    Instead of outputting the colors for the specified window, output the currently configured colors.

.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. _at_get-text:

kitty @ get-text
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ get-text


.. highlight:: sh
.. code-block:: sh

  kitty @ get-text [options] 

Get text from the specified window

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --extent <EXTENT>

    What text to get. The default of screen means all text currently on the screen. all means all the screen+scrollback and selection means currently selected text.
    Default: :code:`screen`
    Choices: :code:`all, screen, selection`

.. option:: --ansi

    By default, only plain text is returned. If you specify this flag, the text will include the formatting escape codes for colors/bold/italic/etc. Note that when getting the current selection, the result is always plain text.

.. option:: --self

    If specified get text from the window this command is run in, rather than the active window.

.. _at_goto-layout:

kitty @ goto-layout
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ goto-layout


.. highlight:: sh
.. code-block:: sh

  kitty @ goto-layout [options] LAYOUT_NAME

Set the window layout in the specified tab (or the active tab if not specified). You can use special match value :italic:`all` to set the layout in all tabs.

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. _at_kitten:

kitty @ kitten
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ kitten


.. highlight:: sh
.. code-block:: sh

  kitty @ kitten [options] kitten_name

Run a kitten over the specified window (active window by default). The :italic:`kitten_name` can be either the name of a builtin kitten or the path to a python file containing a custom kitten. If a relative path is used it is searched for in the kitty config directory. If the kitten is a no_ui kitten and its handle response method returns a string or boolean, this is printed out to stdout.

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. _at_last-used-layout:

kitty @ last-used-layout
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ last-used-layout


.. highlight:: sh
.. code-block:: sh

  kitty @ last-used-layout [options] ...

Switch to the last used window layout in the specified tab (or the active tab if not specified).

Options
______________________________
.. option:: --all, -a

    Change the layout in all tabs.

.. option:: --no-response

    Don't wait for a response from kitty. This means that even if no matching tab is found, the command will exit with a success code.
    Default: :code:`false`

.. option:: --match <MATCH>, -m <MATCH>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. _at_launch:

kitty @ launch
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ launch


.. highlight:: sh
.. code-block:: sh

  kitty @ launch [options] [CMD ...]

 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: :italic:`kitty @ launch --title Email mutt`.

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. option:: --no-response

    Do not print out the id of the newly created window.

.. option:: --self

    If specified the tab containing the window this command is run in is used instead of the active tab

.. option:: --title <WINDOW_TITLE>, --window-title <WINDOW_TITLE>

    The title to set for the new window. By default, title is controlled by the child process.

.. option:: --tab-title <TAB_TITLE>

    The title for the new tab if launching in a new tab. By default, the title of the active window in the tab is used as the tab title.

.. option:: --type <TYPE>

    Where to launch the child process, in a new kitty window in the current tab, a new tab, or a new OS window or an overlay over the current window. Note that if the current window already has an overlay, then it will open a new window. The value of background means the process will be run in the background. The values clipboard and primary are meant to work with :option:`kitty @ launch --stdin-source` to copy data to the system clipboard or primary selection.
    Default: :code:`window`
    Choices: :code:`background, clipboard, os-window, overlay, primary, tab, window`

.. option:: --keep-focus

    Keep the focus on the currently active window instead of switching to the newly opened window.

.. option:: --cwd <CWD>

    The working directory for the newly launched child. Use the special value :code:`current` to use the working directory of the currently active window.

.. option:: --env <ENV>

    Environment variables to set in the child process. Can be specified multiple times to set different environment variables. Syntax: :italic:`name=value`.

.. option:: --copy-colors

    Set the colors of the newly created window to be the same as the colors in the currently active window.

.. option:: --copy-cmdline

    Ignore any specified command line and instead use the command line from the currently active window.

.. option:: --copy-env

    Copy the environment variables from the currently active window into the newly launched child process. Note that most shells only set environment variables for child processes, so this will only copy the environment variables that the shell process itself has not the environment variables child processes inside the shell see. To copy that enviroment, use the kitty remote control feature with :code:`kitty @launch --copy-env`.

.. option:: --location <LOCATION>

    Where to place the newly created window when it is added to a tab which already has existing windows in it. :code:`after` and :code:`before` place the new window before or after the active window. :code:`neighbor` is a synonym for :code:`after`. Also applies to creating a new tab, where the value of :code:`after` will cause the new tab to be placed next to the current tab instead of at the end. The values of :code:`vsplit` and :code:`hsplit` are only used by the :code:`splits` layout and control if the new window is placed in a vertical or horizontal split with the currently active window. The default is to place the window in a layout dependent manner, typically, after the currently active window.
    Default: :code:`default`
    Choices: :code:`after, before, default, first, hsplit, last, neighbor, vsplit`

.. option:: --allow-remote-control

    Programs running in this window can control kitty (if remote control is enabled). Note that any program with the right level of permissions can still write to the pipes of any other program on the same computer and therefore can control kitty. It can, however, be useful to block programs running on other computers (for example, over ssh) or as other users.

.. option:: --stdin-source <STDIN_SOURCE>

    Pass the screen contents as :code:`STDIN` to the child process. :code:`@selection` is the currently selected text. :code:`@screen` is the contents of the currently active window. :code:`@screen_scrollback` is the same as :code:`@screen`, but includes the scrollback buffer as well. :code:`@alternate` is the secondary screen of the current active window. For example if you run a full screen terminal application, the secondary screen will be the screen you return to when quitting the application.
    Default: :code:`none`
    Choices: :code:`@alternate, @alternate_scrollback, @screen, @screen_scrollback, @selection, none`

.. option:: --stdin-add-formatting

    When using :option:`kitty @ launch --stdin-source` add formatting escape codes, without this only plain text will be sent.

.. option:: --stdin-add-line-wrap-markers

    When using :option:`kitty @ launch --stdin-source` add a carriage return at every line wrap location (where long lines are wrapped at screen edges). This is useful if you want to pipe to program that wants to duplicate the screen layout of the screen.

.. option:: --marker <MARKER>

    Create a marker that highlights text in the newly created window. The syntax is the same as for the :code:`toggle_marker` map action (see :doc:`/marks`).

.. option:: --os-window-class <OS_WINDOW_CLASS>

    Set the WM_CLASS property on X11 and the application id property on Wayland for the newly created OS Window when using :option:`kitty @ launch --type`:code:`=os-window`. Defaults to whatever is used by the parent kitty process, which in turn defaults to :code:`kitty`.

.. option:: --os-window-name <OS_WINDOW_NAME>

    Set the WM_NAME property on X11 for the newly created OS Window when using :option:`kitty @ launch --type`:code:`=os-window`. Defaults to :option:`kitty @ launch --os-window-class`.

.. option:: --watcher <WATCHER>, -w <WATCHER>

    Path to a python file. Appropriately named functions in this file will be called for various events, such as when the window is resized, focused or closed. See the section on watchers in the launch command documentation :doc:`launch`. Relative paths are resolved relative to the kitty config directory.

.. _at_ls:

kitty @ ls
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ ls


.. highlight:: sh
.. code-block:: sh

  kitty @ ls 

List all windows. The list is returned as JSON tree. The top-level is a list of operating system kitty windows. Each OS window has an :italic:`id` and a list of :italic:`tabs`. Each tab has its own :italic:`id`, a :italic:`title` and a list of :italic:`windows`. Each window has an :italic:`id`, :italic:`title`, :italic:`current working directory`, :italic:`process id (PID)`,  :italic:`command-line` and :italic:`environment` of the process running in the window.

You can use these criteria to select windows/tabs for the other commands.

.. _at_new-window:

kitty @ new-window
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ new-window


.. highlight:: sh
.. code-block:: sh

  kitty @ new-window [options] [CMD ...]

Open a new window in the specified tab. If you use the :option:`kitty @ 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:
:italic:`kitty @ new-window --title Email mutt`

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. option:: --title <TITLE>

    The title for the new window. By default it will use the title set by the program running in it.

.. option:: --cwd <CWD>

    The initial working directory for the new window. Defaults to whatever the working directory for the kitty process you are talking to is.

.. option:: --keep-focus

    Keep the current window focused instead of switching to the newly opened window

.. option:: --window-type <WINDOW_TYPE>

    What kind of window to open. A kitty window or a top-level OS window.
    Default: :code:`kitty`
    Choices: :code:`kitty, os`

.. option:: --new-tab

    Open a new tab

.. option:: --tab-title <TAB_TITLE>

    When using --new-tab set the title of the tab.

.. option:: --no-response

    Don't wait for a response giving the id of the newly opened window. Note that using this option means that you will not be notified of failures and that the id of the new window will not be printed out.
    Default: :code:`false`

.. _at_remove-marker:

kitty @ remove-marker
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ remove-marker


.. highlight:: sh
.. code-block:: sh

  kitty @ remove-marker [options] 

Remove the currently set marker, if any.

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --self

    If specified apply marker to the window this command is run in, rather than the active window.

.. _at_resize-window:

kitty @ resize-window
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ resize-window


.. highlight:: sh
.. code-block:: sh

  kitty @ resize-window [options] 

Resize the specified window in the current layout. Note that not all layouts can resize all windows in all directions.

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --increment <INCREMENT>, -i <INCREMENT>

    The number of cells to change the size by, can be negative to decrease the size.
    Default: :code:`2`

.. option:: --axis <AXIS>, -a <AXIS>

    The axis along which to resize. If :italic:`horizontal`, it will make the window wider or narrower by the specified increment. If :italic:`vertical`, it will make the window taller or shorter by the specified increment. The special value :italic:`reset` will reset the layout to its default configuration.
    Default: :code:`horizontal`
    Choices: :code:`horizontal, reset, vertical`

.. option:: --self

    If specified resize the window this command is run in, rather than the active window.

.. _at_scroll-window:

kitty @ scroll-window
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ scroll-window


.. highlight:: sh
.. code-block:: sh

  kitty @ scroll-window [options] SCROLL_AMOUNT

Scroll the specified window, if no window is specified, scroll the window this command is run inside. SCROLL_AMOUNT can be either the keywords :code:`start` or :code:`end` or an argument of the form <number>[unit][+-]. For example, 30 will scroll down 30 lines and 2p- will scroll up 2 pages.

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. _at_send-text:

kitty @ send-text
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ send-text


.. highlight:: sh
.. code-block:: sh

  kitty @ send-text [options] [TEXT TO SEND]

Send arbitrary text to specified windows. The text follows Python escaping rules. So you can use escapes like :italic:`\x1b` to send control codes and :italic:`\u21fa` to send unicode characters. If you use the :option:`kitty @ send-text --match` option the text will be sent to all matched windows. By default, text is sent to only the currently active window.

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --match-tab <MATCH_TAB>, -t <MATCH_TAB>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. option:: --all

    Match all windows.

.. option:: --stdin

    Read the text to be sent from :italic:`stdin`. Note that in this case the text is sent as is, not interpreted for escapes. If stdin is a terminal, you can press Ctrl-D to end reading.

.. option:: --from-file <FROM_FILE>

    Path to a file whose contents you wish to send. Note that in this case the file contents are sent as is, not interpreted for escapes.

.. option:: --exclude-active

    Do not send text to the active window, even if it is one of the matched windows.

.. _at_set-background-image:

kitty @ set-background-image
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ set-background-image


.. highlight:: sh
.. code-block:: sh

  kitty @ set-background-image [options] PATH_TO_PNG_IMAGE

Set the background image for the specified OS windows. You must specify the path to a PNG image that will be used as the background. If you specify the special value "none" then any existing image will be removed.

Options
______________________________
.. option:: --all, -a

    By default, background image is only changed for the currently active OS window. This option will cause the image to be changed in all windows.

.. option:: --configured, -c

    Change the configured background image which is used for new OS windows.

.. option:: --layout <LAYOUT>

    How the image should be displayed. The value of configured will use the configured value.
    Choices: :code:`configured, mirror-tiled, scaled, tiled`

.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. _at_set-background-opacity:

kitty @ set-background-opacity
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ set-background-opacity


.. highlight:: sh
.. code-block:: sh

  kitty @ set-background-opacity [options] OPACITY

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: kitty @ set-background-opacity 0.5

Options
______________________________
.. option:: --all, -a

    By default, colors are only changed for the currently active window. This option will cause colors to be changed in all windows.

.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --match-tab <MATCH_TAB>, -t <MATCH_TAB>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. _at_set-colors:

kitty @ set-colors
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ set-colors


.. highlight:: sh
.. code-block:: sh

  kitty @ set-colors [options] COLOR_OR_FILE ...

Set the terminal colors for the specified windows/tabs (defaults to active window). You can either specify the path to a conf file (in the same format as kitty.conf) to read the colors from or you can specify individual colors, for example: kitty @ set-colors foreground=red background=white

Options
______________________________
.. option:: --all, -a

    By default, colors are only changed for the currently active window. This option will cause colors to be changed in all windows.

.. option:: --configured, -c

    Also change the configured colors (i.e. the colors kitty will use for new windows or after a reset).

.. option:: --reset

    Restore all colors to the values they had at kitty startup. Note that if you specify this option, any color arguments are ignored and --configured and --all are implied.

.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --match-tab <MATCH_TAB>, -t <MATCH_TAB>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. _at_set-font-size:

kitty @ set-font-size
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ set-font-size


.. highlight:: sh
.. code-block:: sh

  kitty @ set-font-size [options] FONT_SIZE

Sets the font size to the specified size, in pts. Note that in kitty all sub-windows in the same OS window must have the same font size. A value of zero resets the font size to default. Prefixing the value with a + or - increments the font size by the specified amount.

Options
______________________________
.. option:: --all, -a

    By default, the font size is only changed in the active OS window, this option will cause it to be changed in all OS windows.

.. _at_set-spacing:

kitty @ set-spacing
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ set-spacing


.. highlight:: sh
.. code-block:: sh

  kitty @ set-spacing [options] MARGIN_OR_PADDING ...

Set the padding and margins for the specified windows (defaults to active window). For example: margin=20 or padding-left=10 or margin-h=30. The shorthand form sets all values, the :code:`*-h` and :code:`*-v` variants set horizontal and vertical values. The special value "default" resets to using the default value. If you specify a tab rather than a window, all windows in that tab are affected.

Options
______________________________
.. option:: --all, -a

    By default, settings are only changed for the currently active window. This option will cause colors to be changed in all windows.

.. option:: --configured, -c

    Also change the configured padding and margins (i.e. the settings kitty will use for new windows).

.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. option:: --match-tab <MATCH_TAB>, -t <MATCH_TAB>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. _at_set-tab-title:

kitty @ set-tab-title
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ set-tab-title


.. highlight:: sh
.. code-block:: sh

  kitty @ set-tab-title [options] TITLE ...

Set the title for the specified tab(s). If you use the :option:`kitty @ 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.

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The tab to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, env, cmdline. You can use the :italic:`ls` command to get a list of tabs. Note that for numeric fields such as id and pid the expression is interpreted as a number, not a regular expression. When using title or id, first a matching tab is looked for and if not found a matching window is looked for, and the tab for that window is used.

.. _at_set-window-title:

kitty @ set-window-title
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ set-window-title


.. highlight:: sh
.. code-block:: sh

  kitty @ set-window-title [options] [TITLE ...]

Set the title for the specified window(s). If you use the :option:`kitty @ 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.

Options
______________________________
.. option:: --temporary

    By default, if you use :italic:`set-window-title` the title will be permanently changed and programs running in the window will not be able to change it again. If you want to allow other programs to change it afterwards, use this option.

.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

.. _at_signal-child:

kitty @ signal-child
------------------------------------------------------------------------------------------------------------------------
.. program:: kitty @ signal-child


.. highlight:: sh
.. code-block:: sh

  kitty @ signal-child [options] [SIGNAL_NAME ...]

Send one or more signals to the foreground process in the specified window(s). If you use the :option:`kitty @ signal-child --match` option the title will be set 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 keystroke in kitty.conf, for example::

    map F1 signal_child SIGTERM

Options
______________________________
.. option:: --match <MATCH>, -m <MATCH>

    The window to match. Match specifications are of the form: :italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env. You can use the :italic:`ls` command to get a list of windows. Note that for numeric fields such as id, pid and num the expression is interpreted as a number, not a regular expression. The field 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 :italic:`ls` command). The window id of the current window is available as the KITTY_WINDOW_ID environment variable. When using the :italic:`env` field to match on environment variables you can specify only the environment variable name or a name and value, for example, :italic:`env:MY_ENV_VAR=2`

