Skip to content

Clicking a pane after switching worktrees does not update the active pane highlight #286

@marvtub

Description

@marvtub

Summary

When using split panes, clicking into a pane after switching worktrees does not always update which pane looks active.

The terminal itself appears clickable, but the visual active-pane state stays on the previous pane. The transparency/dimming only updates after clicking the already-highlighted pane again, then clicking the other pane.

Steps to reproduce

  1. Open a worktree with two terminal panes.
  2. Switch to another worktree.
  3. Switch back, or switch between worktrees with split panes.
  4. Click into the pane that is not currently highlighted.

Expected behavior

The pane I click should immediately become the active/highlighted pane.

Actual behavior

The highlighted pane does not change on the first click. It only updates after clicking the currently highlighted pane again, then clicking the other pane.

Notes from a quick code check

This looks like the visual active-pane state is tied to the Ghostty surface becoming first responder. Normal mouseDown forwards the click to Ghostty, but does not appear to explicitly focus the clicked surface when the window is already active. So the click can reach the terminal without updating Supacode's active-pane state.

A likely fix is to focus the clicked surface on mouseDown before forwarding the click.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions