From the gpt-5.6-sol codebase eval (P0). This touches the sacred typing-latency path, so it needs careful, measured work in its own session, not a rushed batch.
Two hot-path costs on every keystroke:
NSWindow.programa_sendEvent computes a hit view for every event before checking its type (Sources/WindowSwizzles.swift:231 -> themeFrame.hitTest at :614); WindowTerminalHostView still calls recursive super.hitTest even though it skips pointer routing for keyboard events (Sources/WindowTerminalHostView.swift:126).
- After text input,
forceRefresh builds interpolated diagnostic state and checks the layer outside #if DEBUG, then does geometry/display reconciliation before the refresh (Sources/TerminalSurface.swift:1430, called from Sources/GhosttyTerminalView+Keyboard.swift:918).
First step: return a nil hit context for non-pointer events and rely on first-responder context; add a minimal requestRedrawAfterInput() that only calls ghostty_surface_refresh, keeping forceRefresh for topology changes. MEASURE p95 keystroke latency before/after with the existing lag harness — do not merge on eyeball.
From the gpt-5.6-sol codebase eval (P0). This touches the sacred typing-latency path, so it needs careful, measured work in its own session, not a rushed batch.
Two hot-path costs on every keystroke:
NSWindow.programa_sendEventcomputes a hit view for every event before checking its type (Sources/WindowSwizzles.swift:231->themeFrame.hitTestat:614);WindowTerminalHostViewstill calls recursivesuper.hitTesteven though it skips pointer routing for keyboard events (Sources/WindowTerminalHostView.swift:126).forceRefreshbuilds interpolated diagnostic state and checks the layer outside#if DEBUG, then does geometry/display reconciliation before the refresh (Sources/TerminalSurface.swift:1430, called fromSources/GhosttyTerminalView+Keyboard.swift:918).First step: return a nil hit context for non-pointer events and rely on first-responder context; add a minimal
requestRedrawAfterInput()that only callsghostty_surface_refresh, keepingforceRefreshfor topology changes. MEASURE p95 keystroke latency before/after with the existing lag harness — do not merge on eyeball.