Skip to content

Fix stale iTerm2 inline images on redraw - #16644

Open
lomavkin wants to merge 1 commit into
warpdotdev:masterfrom
lomavkin:lomavkin/fix-iterm-image-replacement
Open

lomavkin wants to merge 1 commit into
warpdotdev:masterfrom
lomavkin:lomavkin/fix-iterm-image-replacement

Conversation

@lomavkin

@lomavkin lomavkin commented Oct 25, 2026 •

Copy link
Copy Markdown

Description

Redrawing a transparent iTerm2 inline image at the same cursor position leaves the previous image visible underneath it. This causes stale graph lines to accumulate when scrolling in Serie (A rich git commit graph viewer) with --protocol iterm.

Remove existing iTerm image placements at the same anchor before placing the replacement image, after validating the incoming image. Images anchored elsewhere and Kitty image placements are preserved.

Linked Issue

Fixes #16586

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

The linked issue has a standalone reproduction and is labeled bug and repro:high. This is a reproducible bug fix submitted directly as a code PR under the contribution guide.

Testing

Tested on macOS 15.7.3 (Apple Silicon) with Rust 1.92.0.

  • cargo nextest run --locked -p warp_terminal: 560 passed, 2 existing ignored tests skipped.
  • cargo clippy --locked -p warp_terminal --all-targets --tests -- -D warnings: passed.
  • ./script/format: passed.
  • Temporarily removing the image eviction call causes all three replacement regression tests to fail because the old image IDs remain. The fix was restored before running the full crate test suite.

Added regression coverage for:

  • Repeated images at the same position, including replacement with a narrower image and the resulting cursor position.

  • Preserving images anchored at different rows or columns.

  • Preserving Kitty image placements at the same position.

  • Preserving the previous image and cursor position when a zero-width replacement is rejected.

  • I have manually tested my changes locally with ./script/run

Built the local app with ./script/run --features iterm_images --dont-open and opened the resulting WarpOss.app.

Check Observed result
python3 probe.py --mode none, using the script attached to #16586 Stage A shows the red shape. Stage B shows only the cyan shape; the previous red shape disappears without writing spaces.
python3 probe.py --mode space Stage B shows only the cyan shape.
serie -i head --protocol iterm, Serie 0.10.0 in the Warp repository Scrolled with Ctrl-E 12 times; old graph lines did not accumulate.

Screenshots / Videos

Before

probe-before

After

probe-none-after probe-space-after
serie-after.mp4

The before screenshot is from the original Warp recording in #16586. The after screenshots and approximately 18-second Serie recording show the local build based on master commit 1e6c3ae465d6a925a9b97ae03877aaadd159b8f1 with this fix applied.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Changelog Entries for Stable

CHANGELOG-BUG-FIX: Fixed stale inline images remaining visible when applications redraw images using the iTerm2 image protocol.

Remove prior iTerm placements at the same anchor before placing a replacement image.
@cla-bot

cla-bot Bot commented Oct 25, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @lomavkin on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Oct 25, 2026
@lomavkin

Copy link
Copy Markdown
Author

I tried to sign the CLA at https://cla.warp.dev/, but submitting it returns:

“Sign request failed (500): Failed to record signature. Please try again.”

Could you please check the CLA service?

@lomavkin

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot

cla-bot Bot commented Oct 25, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @lomavkin on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@cla-bot

cla-bot Bot commented Oct 25, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@lomavkin

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Oct 26, 2026
@cla-bot

cla-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

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

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iTerm2 inline images leave stale content when redrawn at the same cursor position

1 participant