Skip to content

shellState stays .unknown — dedup records state before panel exists, suppressing all subsequent reports #16

Description

@arzafran

Tracking upstream cmux manaflow-ai#6618verified FIX_NOW (exists in our fork, ship-ready).

Complexity: small

Evidence (our code): Sources/TerminalController.swift:15368-15380 — shouldPublishShellActivity is called and state recorded off-main before main.async; Sources/Workspace.swift:7648 — guard panels[panelId] != nil else { return } silently drops the update if panel not yet registered; Sources/Workspace.swift:6730-6741 — resolveCloseConfirmation returns fallbackNeedsConfirmClose (Ghostty confirm-close) when state is .unknown, producing spurious close-confirmation dialogs.

Proposed fix: In Sources/TerminalController.swift:15368-15380, move the socketFastPathState.shouldPublishShellActivity(...) call and dict update inside the DispatchQueue.main.async block, after confirming the panel is registered. Only record the state in the dedup dict when updateSurfaceShellActivity actually applies the update (panel found). If the panel is absent the first time, the next identical report must not be suppressed. Alternative: make updateSurfaceShellActivity/updatePanelShellActivityState return Bool and call shouldPublishShellActivity only on true.

Upstream: manaflow-ai#6618

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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