Skip to content

Focus intent tracked in two independently-set booleans that can diverge #86

Description

@arzafran

GhosttyNSView.desiredFocus and TerminalSurface.desiredFocusState (Sources/GhosttyTerminalView.swift) both track intended focus and are mutated on different paths. A becomeFirstResponder early-return can update one without the other; an adjacent comment in the file already warns about this exact divergence.

Fix: make one of the two the single source of truth and derive the other, or route all writes through one setter. Note: this is adjacent to the protected typing-latency paths; the fix should not add work to forceRefresh or the keyDown path.


From the 2026-07-09 nuclear review (10 module reviewers + Codex cross-model pass, disprove-first). Line refs are against the reductive-audit branch (PR #81).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnuclear-reviewFrom the 2026-07-09 whole-codebase nuclear review

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions