Skip to content

Responsive pane width, more terminals, and a fuller tree - #2

Merged
simoncoombes merged 4 commits into
mainfrom
responsive-width-and-terminals
Sep 11, 2026
Merged

simoncoombes merged 4 commits into
mainfrom
responsive-width-and-terminals

Conversation

@simoncoombes

Copy link
Copy Markdown
Owner

Four commits, each one concern, each green on its own.

updated readme

tree: grow the history strip into rows nothing else wants

Spare rows used to stay blank. One subagent working alone in a forty-row pane
drew three lines and left thirty-five empty. Those rows now go back into the
per-agent history strip, one tool call at a time, up to max_calls_shown.

Growth stops three rows short of the budget so the next spawn lands without
collapsing every strip, and it does not run at all if the degrade ladder had to
drop a row's activity line, so depth is never bought with breadth.

Also fixes descend rebuilding an arriving agent's block with the shared
ceiling rather than the per-agent budget, making that block taller than the
height the fit ladder had counted.

ui: draw at the pane's width by default

frameWidth capped every frame at 64 columns, so dragging a divider out to 98
left 34 columns blank. fill is now the default and takes the pane's width up
to max_width (100). The extra columns go to text, so the activity line, the
tool-call labels and main's workstream label stop being truncated. w still
reaches the fixed budgets, cycling fill, wide 64, narrow 44.

loadPrefs migrates a ui.json written before fill existed. w used to be a
two-way toggle where wide was the default, so a stored wide almost always
meant "back to normal"; honouring it would leave anyone who had pressed w
twice with a pane that still refuses the room.

autopane: split the pane in tmux, WezTerm and kitty too

Auto-open and the focus jump were iTerm2 AppleScript. pane.go turns each
terminal into a pure function from the environment to an argv, and the three
callers dispatch through it. tmux wins over the terminal hosting it, since a
session in tmux inside iTerm2 lives in a tmux pane.

AGENTPANE_TERMINAL overrides detection. doctor names the backend and
whether its program is on PATH. autopane --explain prints what guard (c)
looked at.

Only the iTerm2 path is live-tested. The other three are covered at the
argv level, which cannot prove the argv is what those CLIs want.
docs/TERMINALS.md marks each row.

Not fixed here

internal/source/codexsrc TestRealCodexSession and two siblings fail against
a real Codex session on disk. They fail on 67d0e6e too and skip in CI.

The tree used to leave spare rows blank: a pane with room to spare showed
more agents, never more about the ones it already had. One subagent working
alone in a forty-row pane drew three lines and left thirty-five empty, and
the question the pane exists to answer got one line with a screenful of
nothing under it.

Spare rows now go back into the per-agent history strip, one tool call at a
time, up to max_calls_shown. Two guards keep it from thrashing: growth stops
three rows short of the budget so the next agent to spawn lands without
collapsing every strip, and it does not run at all if the degrade ladder had
to drop any row's activity line, so depth is never bought with breadth.

Also fixes descend rebuilding an arriving agent's block with the shared
ceiling rather than the per-agent budget, which made that block taller than
the height the fit ladder had just counted. It only showed on an agent that
reached the tree already carrying tool calls, which is why it went unnoticed.
Widening the pane did nothing. frameWidth capped every frame at the 64-column
wide budget, so dragging a divider out to 98 columns left 34 columns blank
with no explanation, which reads as a resize bug. The resize plumbing was
always fine; the renderer refused the room.

fill is now the default layout and takes the pane's own width up to
max_width (100). The extra columns go to text: the activity line, the
tool-call labels and main's workstream label are all budgeted against this
number, so they stop being truncated and things dropped to fit at 64, like
the verify marker on its own row, come back. w still reaches the two fixed
budgets, cycling fill, wide 64, narrow 44.

Adds max_width to config.toml for anyone who wants the ceiling somewhere
else. The budgets stay ceilings and never floors, so every layout already
narrowed with the pane.

loadPrefs migrates a ui.json written before fill existed. w used to be a
two-way toggle where wide was the default, so a stored "wide" almost always
meant "back to normal" and honouring it would leave everyone who had pressed
w twice with a pane that still refuses the room and nothing on screen to
explain why. A stored "narrow" says something the default does not and
survives; a "wide" chosen after the upgrade is written with the new schema
and sticks.
Auto-open and the tab focus jump were iTerm2 AppleScript, which made both of
them macOS features by accident rather than by decision. pane.go turns each
terminal into a pure function from the environment to an argv, so the command
is unit-testable on a machine that has none of these terminals installed, and
the three callers (autopane's split, tab's focus jump, o's new tab) dispatch
through it.

tmux uses split-window -h -d -l, with an unsized fallback for versions before
3.1 where -l does not take a cell count. WezTerm uses cli split-pane and hands
focus straight back. kitty uses launch --location=vsplit, trying kitten before
kitty. The focus jump aims left on every backend, since agentpane is split to
the right of the session by construction and the TUI never saw the id of the
pane it came from.

tmux wins over the terminal hosting it: a session in tmux inside iTerm2 lives
in a tmux pane, and splitting the iTerm2 pane would divide the whole tmux
viewport and leave the new pane outside tmux entirely.

AGENTPANE_TERMINAL overrides the detection, including with "none". A value
that is not a backend name also disables rather than falling through, so a
typo fails where doctor can print it. Each backend's program name is
overridable too (AGENTPANE_TMUX and friends), which is both the test seam and
the way to reach a wrapper or a non-PATH install.

doctor now names the detected backend and whether the program that drives it
is on PATH. autopane --explain guard (c) prints what it looked at when it
finds nothing. o falls back to xdg-open on Linux.

Only the iTerm2 path is live-tested. The other three are covered at the argv
level, which cannot prove the argv is what those CLIs want; docs/TERMINALS.md
marks each one.
@simoncoombes
simoncoombes merged commit 7faf7d9 into main Sep 11, 2026
2 checks passed
@simoncoombes
simoncoombes deleted the responsive-width-and-terminals branch September 11, 2026 13:09
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