Skip to main content

Module pane

Module pane 

Source
Expand description

Pane capture — abstracts how the UI reads the focused agent’s tmux scrollback so tests can stub it out. Production hits tmux capture-pane; tests pass a MockPaneSource with canned lines.

The detail pane in PR-UI-2 polls the PaneSource once per refresh tick (currently 1s, same cadence as the roster) and re-renders. For PR-UI-3 / PR-UI-4 a streaming tmux pipe-pane variant can implement the same trait without changing callers.

Modules§

test_support
Test fixtures. Made pub (rather than #[cfg(test)]) so sibling modules’ tests (e.g. app) can reach them — same pattern as keysender::test_support and compose::test_support.

Structs§

TmuxPaneSource
Production implementation — shells out to tmux capture-pane. -e preserves ANSI escape sequences (T-074 bug 3 fix; without -e the captured output is colour-stripped and the detail pane renders as monochrome regardless of terminal colour mode). -J joins wrapped lines, -p writes to stdout, -S -3000 pulls the last 3000 lines of scrollback. Order of flags is incidental; keep -e adjacent to the other capture-shape flags for grep.

Traits§

PaneSource
Lookup contract: given a tmux session name, return its scrollback as a list of lines. Implementations may bound the depth — the production tmux variant takes the last 3000 lines via capture-pane -S -3000, matching teamctl logs.

Functions§

tail_lines
Take the last n lines so the detail pane never overruns its rect. Free function so tests can pin the slice without constructing a widget.