Repository navigation
Responsive pane width, more terminals, and a fuller tree - #2
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four commits, each one concern, each green on its own.
updated readmetree: grow the history strip into rows nothing else wantsSpare 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
descendrebuilding an arriving agent's block with the sharedceiling 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 defaultframeWidthcapped every frame at 64 columns, so dragging a divider out to 98left 34 columns blank.
fillis now the default and takes the pane's width upto
max_width(100). The extra columns go to text, so the activity line, thetool-call labels and main's workstream label stop being truncated.
wstillreaches the fixed budgets, cycling fill, wide 64, narrow 44.
loadPrefsmigrates aui.jsonwritten before fill existed.wused to be atwo-way toggle where wide was the default, so a stored
widealmost alwaysmeant "back to normal"; honouring it would leave anyone who had pressed
wtwice with a pane that still refuses the room.
autopane: split the pane in tmux, WezTerm and kitty tooAuto-open and the focus jump were iTerm2 AppleScript.
pane.goturns eachterminal 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_TERMINALoverrides detection.doctornames the backend andwhether its program is on
PATH.autopane --explainprints 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.mdmarks each row.Not fixed here
internal/source/codexsrcTestRealCodexSessionand two siblings fail againsta real Codex session on disk. They fail on
67d0e6etoo and skip in CI.