--match,-m
The window to match. Match specifications are of the form: field:query. Where field can be one of:
id, title, pid, cwd, cmdline, num, env, var, state, neighbor, and recent. query is the expression
to match. Expressions can be either a number or a regular expression, and can be combined using
Boolean operators.
The special value all matches all windows.
For numeric fields: id, pid, num and recent, the expression is interpreted as a number, not a
regular expression. Negative values for id match from the highest id number down, in particular,
-1 is the most recently created window.
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 kitten @ ls
command).
The window id of the current window is available as the KITTY_WINDOW_IDenvironmentvariable.
The field recent refers to recently active windows in the currently active tab, with zero being
the currently active window, one being the previously active window and so on.
The field neighbor refers to a neighbor of the active window in the specified direction, which can
be: left, right, top or bottom.
When using the env field to match on environment variables, you can specify only the environment
variable name or a name and value, for example, env:MY_ENV_VAR=2.
Similarly, the var field matches on user variables set on the window. You can specify name or name
and value as with the env field.
The field state matches on the state of the window. Supported states are: active, focused,
needs_attention, parent_active, parent_focused, self, overlay_parent. Active windows are the
windows that are active in their parent tab. There is only one focused window and it is the window
to which keyboard events are delivered. If no window is focused, the last focused window is
matched. The value self matches the window in which the remote control command is run. The value
overlay_parent matches the window that is under the self window, when the self window is an
overlay.
Note that you can use the kitten @ ls command to get a list of windows.
--extent[=screen]
What text to get. The default of screen means all text currently on the screen. all means all the
screen+scrollback and selection means the currently selected text. first_cmd_output_on_screen
means the output of the first command that was run in the window on screen. last_cmd_output means
the output of the last command that was run in the window. last_visited_cmd_output means the first
command output below the last scrolled position via scroll_to_prompt. last_non_empty_output is the
output from the last command run in the window that had some non empty output. The last four
require shell_integration to be enabled.
Choices: screen, all, first_cmd_output_on_screen, last_cmd_output, last_non_empty_output,
last_visited_cmd_output, selection
--ansi By default, only plain text is returned. With this flag, the text will include the ANSI formatting
escape codes for colors, bold, italic, etc.
--add-cursor
Add ANSI escape codes specifying the cursor position and style to the end of the text.
--add-wrap-markers
Add carriage returns at every line wrap location (where long lines are wrapped at screen edges).
--clear-selection
Clear the selection in the matched window, if any.
--self Get text from the window this command is run in, rather than the active window.
--help,-h
Show help for this command