Skip to content

fix: exact session target in CreateWindow, shared key replay, sorted validate - #31

Merged
bthall merged 1 commit into
mainfrom
fix/consistency-pass
Sep 22, 2026
Merged

bthall merged 1 commit into
mainfrom
fix/consistency-pass

Conversation

@bthall

@bthall bthall commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Summary

Three consistency fixes, each with a test.

Exact session target in CreateWindow

CreateWindow targeted SESSION: while every other session target uses the = exact-match prefix. Without it tmux falls back to prefix matching, so a missing session resolves to a longer-named one and the window lands there. It now targets =SESSION:.

TestCreateWindowExactSessionMatch fails on the old code and passes on the new. I also re-drove the multi-window build and mox new -w with the built binary on an isolated tmux server, with a decoy session holding a longer name:

== cx windows
1:one panes=2
2:two panes=1
== decoy windows
1:bash
== cx windows after -w
1:one
2:two
3:adhoc

Shared key-repeat replay

The hub and the editor each had their own loop for splitting batched runes, and they disagreed. The hub kept replaying after a quit, so a fast qi on a tmux-only session imported it instead of quitting. The editor stopped correctly, but its comment said the rest of the batch replayed.

Both now use replayRunes in picker_ui.go. It collects each rune's commands and stops at the rune that quits or suspends for $EDITOR. Both models expose that through quit() / isLeaving().

Sorted layouts in mox validate

Layouts printed in map order, so the listing changed between runs. They now go through a new ListLayoutNames() like sessions do. runValidate writes through cmd.OutOrStdout() so the order is testable.

go test -race ./..., make integration (isolated server), and golangci-lint v2.12.2 are clean. Changelog updated under [Unreleased].

…validate

- CreateWindow targets "=SESSION:" like every other session target. tmux
  fell back to prefix matching, so a missing session resolved to a
  longer-named one and the window landed there. An integration test pins
  it against a real server.
- The hub and editor share one batched-rune replay (replayRunes) that
  collects each rune's commands and stops at the rune that quits or hands
  off to $EDITOR. The hub used to keep replaying after a quit, so a fast
  "qi" imported instead of quitting. The editor's comment described the
  opposite of what its code did; the helper replaces both.
- mox validate prints layouts via a new ListLayoutNames (sorted) instead
  of map order, and writes through the command's output writer so it can
  be tested.
@bthall
bthall merged commit b38bbf6 into main Sep 22, 2026
9 of 10 checks passed
@bthall
bthall deleted the fix/consistency-pass branch September 22, 2026 18:23
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.

1 participant