feat: v0.2.0 — Ghostty + tmux deep integration (truecolor + highlight + hardware-cursor mode)#1
Merged
Merged
Conversation
Design spec for v0.2.0: (A) truecolor + theme-aware cursor colors via pi's Theme.getFgAnsi + optional hex override; (B) char-preserving 'highlight' unfocused style using Ghostty styled underlines through tmux passthrough; (C) opt-in hardware-cursor mode (DECSCUSR + OSC 12) driving Ghostty's native cursor for the focused state, fake-cursor transform for unfocused. Spike-verified C feasible (tui.setShowHardwareCursor public; DECSCUSR/OSC12 persist across pi render frames). Defaults preserve v0.1.1 behavior. Self-reviewed; pending RECTOR review before writing-plans.
…sc12, resolveFocused/UnfocusedColor, themeAccentHex) (v0.2.0 T2)
… bare-char path (v0.2.0 T3)
…d underline, 256 fallback) (v0.2.0 T5)
…areCursor) + blink guard (v0.2.0 T6)
…efocus (v0.2.0 T7)
… threading (v0.2.0 T8)
…Ghostty + tmux deep)
… not empty OSC 12; drop unused FocusedStyle import Code-review fix on PR #1: \x1b]12;\x07 (OSC 12 with empty payload) is undefined behavior; the standard reset-cursor-color is OSC 112 (\x1b]112\x07). Prevents a cosmetic terminal state leak (accent cursor color persisting after pi exits). Also drops the unused FocusedStyle import in editor.ts.
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.
Summary
v0.2.0 deepens
@getpipher/cursorfor the Ghostty + tmux stack across three composing axes (spec:docs/superpowers/specs/2026-07-19-ghostty-tmux-deep-design.md; plan:docs/superpowers/plans/2026-07-19-ghostty-tmux-deep.md):Theme.getFgAnsi("accent"/"dim"), resolved to the theme's color mode (truecolor end-to-end through tmuxTc). OptionalcursorColor: "#RRGGBB"override. The cursor color follows the app theme automatically — no Ghostty-config parsing.highlightunfocused style — a 6th unfocused style: colored undercurl (4:3+58:2::R:G:B) in truecolor, plain colored underline in 256. Preserves the char under the cursor (solves the v0.1 char-hidden limitation for an unfocused state).hardwarecursor mode — drives Ghostty's native cursor for the focused state via DECSCUSR (\x1b[<n> q) + OSC 12 (\x1b]12;<color>\x07), withtui.setShowHardwareCursor(true)+ pi's hardware-cursor positioning. Focused cell renders as a bare char so only the native cursor shows. Unfocused falls back to the fake-cursor transform (with A's colors + B's styles).restoreCursor()onsession_shutdownresets shape/color (no terminal state leak). Native DECSCUSR blink replaces the fake BlinkController in hardware+blink.Defaults preserve v0.1.1 behavior exactly (
cursorColor: "accent",cursorMode: "fake") — no visual regression.Config additions
cursorColor: "accent" | "#RRGGBB"(default"accent")cursorMode: "fake" | "hardware"(default"fake")UnfocusedStylegains"highlight"Commands
/cursor color accent|#RRGGBB/cursor mode fake|hardware/cursor unfocused highlightTasks (9, TDD)
T1 config schema · T2 render color/escape helpers · T3 thread Theme + truecolor · T4 cursorColor hex · T5 highlight undercurl · T6 hardware focused (DECSCUSR/OSC12) · T7 restoreCursor + unfocused/refocus · T8 panel + subcommands · T9 docs + version bump.
Verification
pnpm typecheckclean ·pnpm test:run122/122 pass (was 83 at v0.1.1).pnpm pack --dry-run→@getpither/[email protected], includeslib/render.ts+lib/editor.ts.A/B/C are unit-tested against mocks (mock
Theme, mocktuicapturing DECSCUSR/OSC12 writes) but not verified against a live Ghostty+tmux pane in this release — mirrors the v0.1 herdr + v0.1.1 cmux caveat. Flagged in README + AGENTS + code headers. Hardware mode is Ghostty-targeted (DECSCUSR/OSC12 are standard but only verified on Ghostty here). 256-color theme → OSC 12 skipped (no exact hex). Live-verify checklist in the spec §12.Spike-verified mechanism (C feasibility)
TUI.setShowHardwareCursor(bool)is public; the extension receives thetuiinstance insetEditorComponent((tui, theme, kb) => …).positionHardwareCursor()writes only\x1b[?25hper frame (never DECSCUSR/OSC12) → our mode settings persist across pi render frames.tui.terminal.write(seq)(confirmed —TUI.terminalis public, used ~15× inside pi-tui).Merge → tag
v0.2.0(signed) → release.yml publishes to npm.