Tags: gnachman/iTerm2
Tags
Fill screenshot transparent areas with the session background Screenshots rendered the terminal content with transparent margins and uncovered areas. Composite the session's real background behind the content so the result is opaque and matches what's on screen: a background image with its scaling mode and default-background blend, or the solid background color when there's no image. Window transparency is deliberately ignored since a saved screenshot has nothing behind it. The background is laid out as though the pane were the size of the screenshot (each multi-part piece gets its own), and is rendered one slice at a time so memory stays bounded the way the streaming encoder already is. Slices are produced on the main thread; compositing stays off-main via CGContext. Applied at every output path: the standard save/copy render, the streaming/multi-part encoder, and the live preview. The preview also shows a checkerboard in the area outside the image so the boundary of what will be saved is clear when the content is smaller than the preview.
ChatViewController: fix oversized gaps when the gutter panel first re… …veals an existing chat When the right-gutter chat panel first reveals an existing chat, layoutPanels() attaches the panel (synchronously triggering load() -> reloadData() via viewDidMoveToWindow) before positionPanels() sets the panel frame and before any layout pass. Every row height was therefore measured against a table width of 0, so maxBubbleWidth collapsed to its floor, each bubble wrapped to a sliver and computed absurdly tall, and the bubbles rendered with large gaps. The width-change self-heal in performLayoutNow only re-measures on a width change, and once lastTableViewWidth latches the final width it never re-fires, so the bad heights stuck. Force the re-measure the existing re-scroll comment always intended: on the next runloop, performLayoutNow() lays the table out at the panel's final width, then an explicit reloadData() re-queries heightOfRow against it, then scrollToBottom(). Scoped to the inline-panel reveal path; window mode is unaffected.
Add advanced setting to open tmux windows and tabs in the background Adds the tmuxWindowsOpenInBackground advanced setting (default off). When enabled, new or restored tmux windows and tabs are revealed without taking keyboard focus, so attaching with tmux -CC or having tmux create a window no longer steals focus from the session you are working in. The "open in background" intent is threaded as an explicit openInBackground: parameter from loadTmuxLayout: through openTabWithTmuxLayout: down to insertTab:atIndex:openInBackground: (with appendTab: and addTabAtAutomaticallyDeterminedLocation: variants). Existing callers go through thin wrappers that pass NO, so non-tmux tab insertion is unchanged. When opening in background, insertTab: leaves the current tab selected, reveals the window with orderWindow:NSWindowBelow: instead of makeKeyAndOrderFront:, and skips setCurrentTerminal: so clients do not observe a focus or window steal. Based on the approach in PR #684 by Yifan Gao (gaoyifan), reworked to carry the flag as an explicit parameter rather than transient window state.
AI: extend Anthropic prompt caching to conversation history Prompt caching previously marked only the system block and the last tool definition, so the conversation history (the bulk of an orchestration request, dominated by accumulated tool results) was re-sent uncached on every turn and billed at full input rate. Add a rolling ephemeral cache breakpoint on the last content block of the last message. Anthropic reads the longest matching prefix and excludes cache_control from the cache key, so the block marked this turn becomes a cache read on the next turn once a newer turn is appended after it. String content is promoted to a one-element text block so it has somewhere to carry the marker; array-form messages (tool results) are marked in place and stay byte-stable across turns. To support this, message content blocks gain an optional cache_control field (omitted from the wire when nil, so unmarked blocks serialize unchanged), and AnthropicCacheControl is lifted to file scope so both the system/tools breakpoints and the message breakpoint share it. The live prompt-caching test asserted call 2 re-created zero cache; that held only when system+tools were the sole cached segment. With the rolling marker, call 2 legitimately writes a small entry for its changed last message while reading the shared prefix, so the assertion now requires the read to dominate the tail write. Regenerate the Anthropic live-test cassettes: every Anthropic request body changed, so the prior recordings no longer match and are removed in favor of freshly recorded ones (the safety benchmarks included). Non-Anthropic cassettes are untouched.
Mark faint text, cursor, and images in get_screen_contents output The orchestrator's get_screen_contents tool flattened the terminal grid to plain text, discarding every cell's rendering attributes. Inline shell suggestions and ghost completions (zsh-autosuggestions, fish autosuggest, Claude Code's suggested reply) are rendered faint, so they came through byte-for-byte identical to text the user actually typed, which routinely fooled an agent into mistaking a suggestion for an entered command. Capture the per-cell faint bit (via a new ScreenCharIsFaint accessor, since Swift can't read C bitfields) and the per-character grid coords, then weave markup into the extracted text: - faint runs wrapped in dim markers - a cursor marker spliced at the cursor position - images collapsed to an image placeholder All three use U+27E8/U+27E9 angle brackets, which effectively never occur in real terminal output. The tool description documents the tokens. extractScreenText/cursorMarkupIndex now take a VT100Screen instead of a PTYSession so the logic is unit-testable; added tests covering each markup end-to-end and composed.
Update iTerm2-shell-integration: backport OSC 133 aid= to bash source Close the source/bash.1 drift so "make bash" no longer drops the OSC 133 aid= feature.
AI: remove dead claude-sonnet-4-0 model and its fixtures The Anthropic model claude-sonnet-4-0 returns HTTP 404 for current API keys; it is no longer a reachable alias. Remove it from AIMetadata so the model picker and the per-model live harness sweeps stop offering it. Also delete the now-orphaned captured fixtures that only existed for this model: its two SafetyRefusalFixtures and the 16 AICassettes whose request body targets claude-sonnet-4-0. The live harness derives its model list from AIMetadata, so there are no per-model test methods to remove; the AIMetadataFixtureCoverageTest still passes because no remaining model lacks a refusal fixture.
PreviousNext