| name | kitty |
| description | Kitty terminal remote control — create, read, write, split, resize, and manage terminal panes/tabs/windows via `kitty @` commands. Use for multi-pane workflows, live preview, and terminal orchestration.
<example>
Context: User wants a new split pane
user: "open a new pane to the right"
</example>
<example>
Context: User wants to send text to another pane
user: "run npm test in the other pane"
</example>
<example>
Context: User wants to see what's in a pane
user: "what's showing in pane 9?"
</example>
|
Kitty Remote Control
Control the Kitty terminal multiplexer via kitty @ commands. Create splits, tabs, windows — read from and write to any pane.
Discovery
kitty @ ls | python3 -c "
import sys, json
for w in json.load(sys.stdin):
for tab in w.get('tabs', []):
for win in tab.get('windows', []):
print(f\"id:{win['id']} pid:{win.get('pid','-')} title:{win.get('title','')[:50]} {win.get('columns','?')}x{win.get('lines','?')} focused:{win.get('is_focused',False)}\")
"
Matching
All commands use --match (or -m) to target a pane. Match syntax:
| Field | Example | Notes |
|---|
id:9 | Exact window ID | Most reliable |
title:visor | Regex on title | |
pid:1234 | Process ID | |
cwd:/Projects/tengu | Working directory | |
state:focused | Focus state | |
recent:0 | Most recent (0=active) | |
Combine with and, or, not: --match "title:visor and not id:1"
Read Pane Content
kitty @ get-text --match id:9
kitty @ get-text --match id:9 --extent screen
kitty @ get-text --match id:9 --extent selection
Write to Pane
kitty @ send-text --match id:9 'echo hello\r'
kitty @ send-text --match id:9 'some text'
kitty @ send-key --match id:9 ctrl+c
kitty @ send-key --match id:9 escape
Create Panes (Splits)
kitty @ launch --location hsplit
kitty @ launch --location vsplit
kitty @ launch --location vsplit --next-to id:9
kitty @ launch --location hsplit htop
kitty @ launch --location vsplit --title "Preview"
kitty @ launch --location vsplit --cwd /Users/chi/Projects/marauder-os
kitty @ launch --location split
Create Tabs
kitty @ launch --type tab
kitty @ launch --type tab --tab-title "Tests" cargo test
kitty @ launch --type tab --location after
Create OS Windows
kitty @ launch --type os-window
kitty @ launch --type os-window --os-window-title "Debug"
Focus
kitty @ focus-window --match id:9
kitty @ focus-tab --match title:Tests
Resize
kitty @ resize-window --match id:9 --increment 5 --axis horizontal
kitty @ resize-window --match id:9 --increment 5 --axis vertical
kitty @ resize-window --match id:9 --axis reset
Close
kitty @ close-window --match id:9
kitty @ close-tab --match title:Tests
Overlays
kitty @ launch --type overlay less /tmp/log.txt
kitty @ launch --type overlay-main bash
Markers (Highlighting)
kitty @ create-marker --match id:9 text 1 "ERROR"
kitty @ remove-marker --match id:9
Common Patterns
Run a command in a new split and watch output
ID=$(kitty @ launch --location vsplit --title "Test Runner" cargo test)
kitty @ get-text --match id:$ID
Side-by-side preview
kitty @ launch --location vsplit --title "Preview" --cwd /tmp
kitty @ send-text --match title:Preview 'watch -n1 cat output.txt\r'
Clear and write fresh content
kitty @ send-text --match id:9 'clear\r'
sleep 0.2
kitty @ send-text --match id:9 'echo "fresh content"\r'
Notes
- All
kitty @ commands require allow_remote_control in kitty.conf
- Window IDs are stable for the session lifetime — use them over titles for reliability
launch returns the new window ID on stdout — capture it for later reference
send-text with \r simulates pressing Enter
- For sending special keys use
send-key instead of send-text