Skip to content

Phase 2.1 — Open investigations in named tmux windows instead of splitting the TUI pane #330

Description

@ooloth

Phase 2.1 of #327. The title numbering is the work order: take milestone issues in Phase N.M order. The one hard dependency is #331 on #330, recorded as blockedBy; the rest is sequence, not blocking. Read gh issue view 327 --comments for the plan of record.

Current state

Launching more than one or two investigations crowds the TUI out of the viewport, and no investigation is addressable afterwards. ui/tui/src/investigations/launch.rs:110 runs tmux split-window -h -t $TMUX_PANE, so every investigation subdivides the TUI's own pane and none of them carries a name. The same file already uses tmux new-window -n <name> for open_in_lazygit (line 150) and open_in_octo (line 186), with the name built from repo and PR number, so the pattern exists but the investigation path does not use it.

#54 previously fixed which pane the split targets. Moving to a named window supersedes that mechanism rather than regressing it.

Ideal state

  • Pressing i opens the investigation in its own tmux window rather than a split of the TUI's pane
  • The window name is derived deterministically from the signal, so the same item always produces the same name
  • The TUI keeps its full window when an investigation launches
  • Several investigations run at once, each in its own named window, reachable from tmux's window list
  • Launching outside tmux still fails with the existing clear message

Out of scope

  • Refusing to open a second window for an item that already has one — that is the next issue in this phase, and it depends on the names this one introduces
  • Prompt content, model selection, and allowed tools, which are unchanged
  • Worktree resolution, which is unchanged

Starting points

  • ui/tui/src/investigations/launch.rslaunch() at line 64, and the new-window naming already used by open_in_lazygit at line 150
  • ui/tui/src/investigations/mod.rs — the module doc describes the split-window behavior and needs to change with it

QA plan

  1. Start the TUI in tmux, select a PR, press i — expect a new tmux window rather than a split, with the TUI still occupying its full window
  2. Run tmux list-windows — expect a window whose name identifies that PR by repo and number
  3. Return to the TUI, select a different PR, press i — expect a second, separately named window, with the TUI still full-size
  4. Switch into one of the investigation windows — expect a running Claude Code session with the same prompt it received before this change
  5. Run the TUI outside tmux and press i — expect the existing "not in tmux" error rather than a panic

Done when

Pressing i opens a deterministically named tmux window instead of splitting the TUI's pane.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions