Skip to content

fix(sidebar): the rail hands the cursor back to the person's pane - #25

Merged
hishboy merged 1 commit into
tribes-protocol:mainfrom
lucy-wolfe:fix/rail-mint-keeps-focus
Sep 3, 2026
Merged

hishboy merged 1 commit into
tribes-protocol:mainfrom
lucy-wolfe:fix/rail-mint-keeps-focus

Conversation

@lucy-wolfe

Copy link
Copy Markdown
Contributor

The report

A bare chief opens the company with the cursor in the sidebar rail instead of in the person's pane, so the operator's first keystrokes go to furniture.

The cause

Both rail-mint sites run split-window with no -d, which leaves the new rail as the window's active pane and nothing ever gives the cursor back:

  • attach.rs::rail_mint_argv — the frame a fresh attach publishes.
  • actuate/interpret.rs — the actuator's repair batch for a window missing its rail.

The missing -d is deliberate and stays: every write after the split names a WINDOW, and tmux resolves a window target to its active pane, so the rail must be active while it is tagged and resized. A -d split would need a second tmux invocation to name the pane, and a rail observable untagged is the gap that once put two rails in one window.

The fix

Each mint frame now ends with select-pane -l at that window — the window's last pane, which a split makes the pane that was active before it. Measured on tmux 3.7c: this holds even when the split targeted some other pane, so the cursor returns to the operator and never to the split target.

Tests

  • the_rail_frame_hands_the_cursor_back_after_every_other_write (attach.rs) — the selection is last, and every window-targeted write precedes it.
  • a_repaired_rail_gives_the_cursor_back_after_it_is_tagged (interpret) — same rule on the repair batch.
  • a_real_rail_mint_leaves_the_person_pane_active and real_rail_repair_leaves_the_person_pane_active_and_not_the_rail — real tmux: run the frame, then ask the server which pane is active.

Both real tests were run as controls with the selection removed; both fail there and report the rail as active, which is the operator's report reproduced exactly.

Local: cargo fmt --check clean, cargo clippy --workspace --all-targets -- -D warnings clean, attach:: module green (68 passed), interpret::tests green, bun run test:pre-push-guards 99/99, exit 0.

🤖 Generated with Claude Code

A bare `chief` opened the company with the cursor in the sidebar rail
instead of in the pane the operator types into, so their first keystrokes
went to furniture.

Both rail-mint sites split without `-d` on purpose: every write that
follows names a WINDOW, and tmux resolves a window target to its active
pane, so the new rail has to be active while it is tagged and resized.
Each frame now ENDS with `select-pane -l` at that window — the last pane,
which a split makes the pane that was active before it, even when the
split targeted some other pane.

Pinned by argv tests at both sites (which fail if the selection is
dropped or moved ahead of the tag) and by two real-tmux tests that ask
the server which pane is active after the frame runs. Both real tests
were run as controls with the selection removed and reproduce the
operator's report exactly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@lucy-wolfe
lucy-wolfe requested a review from hishboy as a code owner September 3, 2026 13:20
@hishboy
hishboy merged commit c38023f into tribes-protocol:main Sep 3, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants