Repository navigation
feat(terminal-progress): add kitty support (0.47+) - #84
Merged
pedropombeiro merged 4 commits intoOct 10, 2026
Merged
Conversation
Detect kitty via KITTY_WINDOW_ID (set by kitty itself for every process it launches, so it works even without shell integration / TERM_PROGRAM) or TERM_PROGRAM=kitty. kitty has reported OSC 9;4 progress since 0.39 (percentage in tab title) and draws an in-window progress bar since 0.47.
kitty only renders an in-window progress bar since 0.47 (progress_bar option). Older versions show at most a percentage in the tab title (0.39-0.46), and before 0.38 OSC 9;4 was misread as a notification. Keep the plugin a no-op unless the running kitty is confirmed to be at least 0.47. Version is read from TERM_PROGRAM_VERSION when the shell integration exported it, otherwise on Linux by querying the running emulator binary via /proc/<KITTY_PID>/exe.
…ging visuals kitty clears any OSC 9;4 progress ~60 s after the last report, so a single report per state change made the indicator disappear during longer runs. Re-report the active state every 30 s while it lasts, but only on kitty and without changing what is reported: busy stays indeterminate (9;4;3), matching the canonical ConEmu/OSC 9;4 behaviour and the visuals of the other supported terminals (spinner/pulse on Windows Terminal, Ghostty, WezTerm, VTE, iTerm2).
… its real version kitty never sets TERM_PROGRAM or TERM_PROGRAM_VERSION, so the version was often read from whatever else set them (e.g. tmux 3.4 passing the 0.47 gate on an older kitty), and a KITTY_WINDOW_ID leaked into a nested Ghostty or WezTerm hijacked their detection. - Treat the host as kitty only when TERM_PROGRAM is unset, tmux or kitty. - Trust TERM_PROGRAM_VERSION only alongside TERM_PROGRAM=kitty. - Run /proc/<KITTY_PID>/exe directly (works after upgrades), only if it resolves to a kitty binary, with a 2 s timeout. - Fall back to the binary in KITTY_INSTALLATION_DIR (Linux and macOS). - Move detection into kitty.ts with unit tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
What
Adds kitty support to
opencode-terminal-progress, gated on kitty 0.47+ — the version thatdraws an in-window progress bar (
progress_baroption inkitty.conf) and shows the stateindicator in the tab title.
Detection & version gate
KITTY_WINDOW_IDis set by kitty itself for every process it launches (also without shellintegration / when
TERM_PROGRAMis missing) — the kitty equivalent ofITERM_SESSION_ID/WEZTERM_EXECUTABLE.TERM_PROGRAM_VERSION(shell integration) or, on Linux, by resolving therunning emulator binary via
/proc/<KITTY_PID>/exeand running--version. If the version cannotbe confirmed as ≥ 0.47, the plugin stays a no-op.
setupis async (await detectTerminal()) — allowed byPlugin.Definition.Keeping the kitty indicator alive
kitty auto-clears any OSC 9;4 progress ~60 s after the last report (
clear_timeoutinkitty/kitty/progress.py), so a single report per state change made the indicator vanish duringlonger runs. While a state is active the plugin now re-reports it every 30 s — only on kitty, and
with the same canonical payload: busy
9;4;3(indeterminate), waiting9;4;4;50, error9;4;2,idle
9;4;0. No determinate9;4;1;Nsequences are emitted; busy stays indeterminate, matchingthe canonical ConEmu/OSC 9;4 semantics and the visuals of the other supported terminals
(Windows Terminal, Ghostty, WezTerm, VTE, iTerm2 render indeterminate as a spinner/pulse).
Checks
tsc --noEmit✅ · ESLint ✅ ·bun build✅9;4;3per heartbeat with no9;4;1;N; waiting emits4;50, error2, idle0.50 % on questions, clears on idle.