kitty
Original:🇺🇸 English
Translated
Instructions for using kitty remote control to spawn windows/tabs, send text, inspect output, and manage processes. Useful for running servers or long-running tasks in the background.
2installs
Sourcexyenon/agents
Added on
NPX Install
npx skill4agent add xyenon/agents kittyTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Kitty Remote Control Skill
This skill empowers you to manage multiple concurrent processes (like servers, watchers, or long builds) using kitty's remote control feature directly from the tool.
BashSince you are running inside a kitty terminal, you can spawn new windows or tabs to handle these tasks without blocking your main communication channel.
1. Verify Environment & Check Status
First, verify you are running inside kitty with remote control enabled. You can try listing windows:
bash
kitten @ lsIf this fails, check if is set. Note that in some configurations it might be empty even if remote control is enabled (using default sockets).
$KITTY_LISTEN_ONbash
echo $KITTY_LISTEN_ONIf remote control is not enabled, the user should add to their or start kitty with .
allow_remote_control yeskitty.conf--allow-remote-control2. Spawn a Background Process
To run a command (e.g., a dev server) in a way that persists and can be inspected:
-
Create a new window in the SAME tab as the agent (recommended): Useto ensure the new window stays with you.
$KITTY_WINDOW_IDbashWID=$(kitten @ launch --match "id:$KITTY_WINDOW_ID" --title "server-log" --keep-focus) echo "Created window with ID: $WID" -
Or create a new tab:bash
kitten @ launch --type=tab --title "server-log" --keep-focus -
Launch with a command directly: (Useif you want the window to stay open after the command finishes)
--holdbashkitten @ launch --title "server-log" --keep-focus --hold npm start
3. Send Text/Commands to a Window
Send keystrokes to a specific window. Use the window ID for precision, or matching for convenience.
Using ID (Reliable):
bash
kitten @ send-text --match "id:$WID" "npm start\n"Using Matching (Title):
Note: Use for Enter. In some shells, you may need to use or pipe to ensure the newline is interpreted correctly.
\n$'...'bash
kitten @ send-text --match "title:server-log" "npm start
"
# OR
echo "npm start" | kitten @ send-text --match "title:server-log" --stdinOr send to all windows:
bash
kitten @ send-text --all "echo hello\n"4. Inspect Output (Get Text from Window)
Get the current visible text from a window:
bash
kitten @ get-text --match "id:$WID"Get text including scrollback buffer:
bash
kitten @ get-text --match "title:server-log" --extent=allGet only the last command output (requires shell integration):
bash
kitten @ get-text --match "title:server-log" --extent=last_cmd_output5. Focus or Bring Window to Front
Focus a specific window:
bash
kitten @ focus-window --match "id:$WID"Focus a specific tab:
bash
kitten @ focus-tab --match "title:server-log"6. Interact with Processes
Send Ctrl+C (Interrupt):
bash
kitten @ send-text --match "id:$WID" "\x03"Close a window:
bash
kitten @ close-window --match "id:$WID"Close a tab:
(Note: You can close a tab by matching its title or any window ID inside it)
bash
# By ID of a window inside the tab
kitten @ close-tab --match "id:$WID"
# By tab title
kitten @ close-tab --match "title:server-log"7. Advanced: Window Matching
Kitty supports powerful matching expressions:
- - Match by window title
title:pattern - - Match by window ID
id:number - - Match by process ID
pid:number - - Match by current working directory
cwd:path - - Match by command line
cmdline:pattern - - Match the focused window
state:focused - - Match the active window
state:active
Combine with , , :
andornotbash
kitten @ focus-window --match "title:server and state:active"8. Get Window/Tab Information
List all OS windows, tabs, and windows as JSON:
bash
kitten @ lsGet current focused window ID:
bash
kitten @ ls | jq -r '.[].tabs[] | select(.is_focused) | .windows[] | select(.is_focused) | .id'Parse for specific info:
bash
kitten @ ls | jq '.[].tabs[].windows[] | {id, title, cmdline}'Summary of Pattern
- - Create window and save ID
WID=$(kitten @ launch --title "NAME" --keep-focus [CMD]) - - Send command reliably
kitten @ send-text --match "id:$WID" "CMD\n" - - Read output
kitten @ get-text --match "id:$WID" - - Cleanup
kitten @ close-window --match "id:$WID"
Common Remote Control Commands
| Command | Description |
|---|---|
| List all windows/tabs |
| Create new window/tab |
| Send text to window |
| Get text from window |
| Focus a window |
| Focus a tab |
| Close a window |
| Close a tab |
| Send signal to process |
| Change tab title |
| Change terminal colors |