Skip to content

Add swarmforge tmux open - #107

Merged
CrypticSwarm merged 3 commits into
masterfrom
tmux-worktree-helper
Nov 19, 2026
Merged

CrypticSwarm merged 3 commits into
masterfrom
tmux-worktree-helper

Conversation

@CrypticSwarm

@CrypticSwarm CrypticSwarm commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

swarmforge tmux open [PATH] [--name NAME] [--detach] opens a repo as one tmux session: a Repo window at the root, then the default branch's worktree, then the rest.

  • Same session from anywhere: the root, .git, or any worktree of a repo open the same session.
  • Safe to re-run: a re-run only adds windows for new worktrees and never types into an open one.
  • Built to extend: open sits under tmux so recorded repos can join it later as --org / --all. Worktree discovery lives in swarmforge.worktrees so swarmforge spawn can reuse it.

Not covered by the tests: they fake tmux, so attaching (switch-client inside tmux, attach-session outside) still needs a manual run against a real tmux server.

Deferred:

  • Window matching: an open window is matched by name. When two worktrees' names title-case alike and one is later removed, a re-run can leave the other without a window. Tagging windows by path belongs with swarmforge spawn, which needs that mapping anyway.
  • Session names: basename names could collide under a future --all; that PR decides.

The tmux tests build real repositories too, so the neutered git
environment and the scratch-dir base class move out of
test_worktrees.py into tests/git_fixtures.py.
The tmux command needs git's stdout/stderr contract, so it moves into
swarmforge.command for both to use. Its new `quiet` keeps git's fatal
line out of the default-branch probes, whose callers already replace a
failure with their own message.
Replaces a personal helper script. The worktree discovery lives in
swarmforge.worktrees so `swarmforge spawn` can reuse it.

`open` is a verb under `tmux` so recorded repos picked by --org/--all
can join it later without a new verb.
@CrypticSwarm
CrypticSwarm merged commit 06fe2f9 into master Nov 19, 2026
4 checks passed
@CrypticSwarm
CrypticSwarm deleted the tmux-worktree-helper branch November 19, 2026 23:47
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