Repository navigation
embedded: add ghostty_surface_is_alternate_screen - #236
Conversation
Expose whether the terminal's active screen is the alternate screen as a cheap surface query. It takes the renderer state mutex and reads terminal.screens.active_key, the same locking as ghostty_surface_mouse_captured. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds a public API to query whether a terminal surface’s active screen is the alternate screen. The implementation checks the active screen while holding the renderer-state mutex. ChangesAlternate-screen query
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~8 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The new query exposes the active-screen state through the public C API. No concrete behavior or integration failure is evident; normal build checks remain appropriate. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Compile check: rebased onto current main (clean cherry-pick) and built the embedded C API library on Linux with |
Adds a cheap C API query for whether a surface's terminal is on the alternate screen:
Implementation:
Surface.isAlternateScreen()takesrenderer_state.mutex(lockUncancelable), readsio.terminal.screens.active_key == .alternate, and unlocks. This is the same locking asghostty_surface_mouse_captured/Surface.mouseCaptured(), and the export sits next to it inembedded.zigandghostty.h.Why: cmux#14863 (manaflow-ai/cmux#14863) gates text-editing gestures and the
terminalAlternateScreenshortcut when-key on whether the terminal is in the alternate screen. It currently detects that through a costlier probe (viewport serialization with a cached result). This export lets cmux replace that with a direct query.cmux will adopt this in a follow-up after it lands. #14863 does not bump the submodule.
Not compiled locally; the fork's Test workflow skips build jobs, so this is unbuilt until a GhosttyKit build picks it up.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Adds a cheap C API query to check whether a surface's terminal is in the alternate screen.
ghostty_surface_is_alternate_screenalongsideghostty_surface_mouse_captured, using the same renderer state mutex locking.terminalAlternateScreenshortcut.Written for commit 1021743. Summary will update on new commits.
Summary by CodeRabbit