Add kitty terminal emulator backend#52
Open
DmitryAkDev wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add kitty terminal emulator backend
Add support for kitty as a subagent surface backend, enabling spawning and management of sub-agents in separate kitty windows or tabs via the
kitten @remote control API.What's Included
kitty Backend (
cmux.ts)isKittyRuntimeAvailable()checksKITTY_PID+KITTY_WINDOW_ID+ remote control viaKITTY_LISTEN_ONsocket (works from TUI context where/dev/ttyis unavailable)window(default) — split window inside current tab, auto-balanced side-by-side viahorizontallayouttab— new dedicated tab with full terminal spacehorizontallayout for equal-width side-by-side windowsConfiguration (
index.ts)kitty-mode: taborkitty-mode: windowin agent.mdYAML frontmatter"window")Documentation (
README.md)Requirements
Add to
~/.config/kitty/kitty.conf:Then start pi inside kitty:
kitty piOr force via environment:
PI_SUBAGENT_MUX=kittyAPI Mapping
kitten @ launch --type=window --location vsplit --keep-focuskitten @ launch --type=tab --keep-focuskitten @ send-text --match id:Nkitten @ action --match id:N send_key Escapekitten @ get-text --match id:Nkitten @ close-window --match id:Nkitten @ set-window-title --match id:Nkitten @ goto-layout horizontalTesting
Tested on kitty 0.46.2:
Notes
horizontallayout chosen overgridfor side-by-side arrangement (grid creates 2×2 layout)splitslayout remembers old sizes — not suitable for rebalance (switching to grid then back to splits restores original proportions)KITTY_LISTEN_ON) used instead of/dev/ttyDCS sequences for TUI compatibility