kitten-@-get-text(1)
okay bestie, welcome to the kitten-@-get-text page from the kitten manual π
β¨ this is the command that grabs text out of a window, and we are going to go through every single flag like it's a group-chat receipt. no cap.
π Name π
kitten-@-get-text β Get text from the specified window. That is literally the whole name and the whole job: it gets text from a window. π
π Usage π
kitten @ get-text
Run it exactly like that, bestie. π«Ά
πΈ Description πΈ
Get text from the specified window. Yep β it's giving βgrab the text from the window you point at,β and honestly that is iconic. β¨
π Options π
--match,-mβ The window to match. Match specifications are of the form:field:query. Wherefieldcan be one of:id,title,pid,cwd,cmdline,num,env,var,state,neighbor,sessionandrecent.queryis the expression to match. Expressions can be either a number or a regular expression, and can be combined using Boolean operators.- The special value
allmatches all windows. π - For numeric fields:
id,pid,numandrecent, the expression is interpreted as a number, not a regular expression. Negative values foridmatch from the highest id number down, in particular,-1is the most recently created window. - The field
numrefers 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 thekitten @ lscommand). - The window id of the current window is available as the
KITTY_WINDOW_IDenvironment variable. - The field
recentrefers 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
neighborrefers to a neighbor of the active window in the specified direction, which can be:left,right,toporbottom. - The field
sessionmatches windows that were created in the specified session. Use the expression^$to match windows that were not created in a session and.to match the currently active session and~to match either the currently active session or the last active session when no session is active. - When using the
envfield 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
varfield matches on user variables set on the window. You can specifynameornameand value as with theenvfield. - The field
statematches on the state of the window. Supported states are:active,focused,needs_attention,parent_active,parent_focused,focused_os_window,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
focused_os_windowmatches all windows in the currently focused OS window. The valueselfmatches the window in which the remote control command is run. The valueoverlay_parentmatches the window that is under theselfwindow, when theselfwindow is an overlay.
- 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
- Note that you can use the
kitten @ lscommand to get a list of windows. π¦
- The special value
--extent [=screen]β What text to get. The default ofscreenmeans all text currently on the screen.allmeans all the screen+scrollback andselectionmeans the currently selected text.first_cmd_output_on_screenmeans the output of the first command that was run in the window on screen.last_cmd_outputmeans the output of the last command that was run in the window.last_visited_cmd_outputmeans the first command output below the last scrolled position viascroll_to_prompt.last_non_empty_outputis the output from the last command run in the window that had some non empty output. The last four requireshell_integrationto be enabled.alternatemeans the text in the screen that is not currently visible (if the terminal is in the main screen this is the secondary/alternate screen and vice versa).alternate_scrollbackis the same but also includes the scrollback buffer (if any).- Choices:
screen,all,alternate,alternate_scrollback,first_cmd_output_on_screen,last_cmd_output,last_non_empty_output,last_visited_cmd_output,selection
- Choices:
--ansi [=no]β 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 [=no]β Add ANSI escape codes specifying the cursor position and style to the end of the text. π―--add-wrap-markers [=no]β Add carriage returns at every line wrap location (where long lines are wrapped at screen edges).--clear-selection [=no]β Clear the selection in the matched window, if any.--self [=no]β Get text from the window this command is run in, rather than the active window. π--help,-h [=no]β Show help for this command.
π Global options π
--toβ An address for thekittyinstance to control. Corresponds to the address given to thekittyinstance via the--listen-onoption or thelisten_onsetting inkitty.conf. If not specified, the environment variableKITTY_LISTEN_ONis checked. If that is also not found, messages are sent to the controlling terminal for this process, i.e. they will only work if this process is run within akittywindow.--passwordβ A password to use when contactingkitty. This will causekittyto ask the user for permission to perform the specified action, unless the password has been accepted before or is pre-configured inkitty.conf. To use a blank password specify--use-passwordasalways.--password-file [=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. Usefd:numto read from the file descriptornum. Used if no--passwordis supplied. Defaults to checking for therc-passfile in the kitty configuration directory. π--password-env [=KITTY_RC_PASSWORD]β The name of an environment variable to read the password from. Used if no--password-fileis supplied. Defaults to checking the environment variableKITTY_RC_PASSWORD.--use-password [=if-available]β If no password is available,kittywill usually just send the remote control command without a password. This option can be used to force it to always or never use the supplied password. If set toalwaysand no password is provided, the blank password is used.- Choices:
if-available,always,never
- Choices:
that's the whole page, bestie π«Ά this was kitten-@-get-text from the kitten manual, version 0.49.2, dated Oct 01, 2026. go get that text π
β¨
π¦ where this page comes from
- arch rolling: kitty 0.49.2-1 Β· GPL-3.0-only
- nixpkgs unstable: kitty-bin 0.49.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms