fix(terminal): render startup inline images#10478
fix(terminal): render startup inline images#10478KimHyeongRae0 wants to merge 4 commits intowarpdotdev:masterfrom
Conversation
|
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 @KimHyeongRae0 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 |
|
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 @KimHyeongRae0 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 |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR reroutes completed inline image actions during startup and early-output phases so image-only output can create/render output or background blocks instead of being dropped into prompt/header handling.
Concerns
- The production change covers both iTerm and Kitty image completions, but the added regression coverage only exercises iTerm images.
Verdict
Found: 0 critical, 0 important, 1 suggestions
Approve with nits
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| } | ||
|
|
||
| #[test] | ||
| fn test_iterm_image_early_output_routes_to_background_block() { |
There was a problem hiding this comment.
💡 [SUGGESTION] Add at least one Kitty image completion test for the startup/early-output routes; the production changes also route handle_completed_kitty_action, but the new coverage only exercises iTerm images, leaving Kitty's response and metadata path unverified.
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR routes completed iTerm2/Kitty image actions through startup and early-output paths so startup/background inline images can render in output blocks, and adds focused unit coverage for those paths.
Concerns
- Image-only Kitty placements that use the no-cursor-move policy can still be hidden because
should_show_as_empty_when_finishedshort-circuits onfinished_len() == 0before the new visible-image check can keep the block visible. - This is a user-visible terminal rendering behavior change, but the PR includes no screenshot or recording. Manual testing is required for changes that can be manually tested. Please include screenshots or a screen recording that show it working end to end, or justify why visual evidence is not possible.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| pub fn should_show_as_empty_when_finished(&self) -> bool { | ||
| self.finished_len() == 0 | ||
| || !self.has_visible_chars() | ||
| || !self.has_visible_content() |
There was a problem hiding this comment.
C=1 do not move the cursor, so finished_len() == 0 remains true and this grid is still hidden before has_visible_content() can preserve it; include visible images in the zero-length case or otherwise account for non-moving placements.
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR routes completed inline image actions through the startup and early-output paths so image-only shell startup/background output can render as normal output. I found no security-specific concerns in the changed code.
Concerns
- The ScriptExecution path starts the block before the image handler has validated that the completion creates visible content, so disabled/invalid iTerm images and non-display Kitty actions can create a startup block despite no renderable placement.
- The early-output Kitty path similarly starts and inserts a background block for any Kitty action, including StoreOnly, QuerySupport, Delete, unknown IDs, and zero-sized placements, which bypasses the existing pending-block guard that only promotes meaningful background output.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
|
||
| fn handle_completed_iterm_image(&mut self, image: ITermImage) { | ||
| delegate_to_block!(self.handle_completed_iterm_image(image)) | ||
| if self.bootstrap_stage == BootstrapStage::ScriptExecution && !self.active_block().started() |
There was a problem hiding this comment.
| ) -> Option<KittyResponse> { | ||
| let session_id = self.block_list.active_block().session_id(); | ||
| self.with_background_output(|block| { | ||
| if !block.started() { |
There was a problem hiding this comment.
Description
Fixes inline image protocol routing during shell startup and early output.
Completed iTerm2 and Kitty image actions previously bypassed the early-output path, and block-level routing could send images received before preexec into the prompt/header grid. That made startup or background image output parse successfully but not render like normal command output.
This change:
WarpInputbootstrap behavior.ScriptExecutionblock when its first visible content is an image completion.EarlyOutputHandlerso background image output creates a renderable background block.Linked Issue
Closes #10020
ready-to-implement.Testing
cargo fmt -- --checkgit diff --checkcargo clippy -p warp --all-targets --tests -- -D warningscargo test -p warp test_non_moving_kitty_image_keeps_finished_grid_visiblecargo test -p warp test_image_completioncargo test -p warp test_iterm_imagecargo test -p warp test_kitty_imagetarget/debug/warp-ossbinary built by./script/run --dont-openManual GUI validation passed on macOS with a temporary zsh startup script running
fastfetch --logo-type kitty-direct. Warp rendered the startup image output as a normal output block, including theWARP_INLINE_IMAGE_STARTUP_TEST_BEGIN/WARP_INLINE_IMAGE_STARTUP_TEST_ENDmarkers and the emitted image.Screenshots / Videos
No screenshot or video is attached because this update is being made from the GitHub CLI/API environment, which does not provide GitHub's browser-based PR attachment upload flow. The manual GUI validation above is the end-to-end visual check: a local
warp-ossbuild launched with the temporary startup script, and the terminal rendered the fastfetch Kitty-direct image between the startup markers instead of dropping it.Agent Mode
CHANGELOG-BUG-FIX: Render inline image protocols emitted during shell startup instead of dropping them.