fix(cli): spec-compliant terminal image rendering + Windows clipboard… - #974
Open
smarpitm wants to merge 1 commit into
Open
fix(cli): spec-compliant terminal image rendering + Windows clipboard…#974smarpitm wants to merge 1 commit into
smarpitm wants to merge 1 commit into
Conversation
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.
What
Fixes terminal inline image rendering so attached photos display correctly in kitty-capable terminals, and hardens Windows clipboard image paste.
Why
Photos attached via
/imageor Ctrl+V could render "distorted":m=0terminator and every chunk repeateda=T/full control data, so terminals treated each chunk as a new image (fragmented display). The format id was also hardcoded tof=100(PNG) even for the JPEG payloads the compression step produces.sizeparam sent the base64 length instead of the decoded byte length (minus padding).powershell.exe(nopwshfallback).Changes
cli/src/utils/terminal-images.ts— spec-compliant kitty chunking (m=0on the last chunk, control data only on the first), format id derived from the real media type, iTerm2size= decoded bytes, detection for WezTerm/Ghostty/Warp/Konsole (case-insensitive).cli/src/utils/clipboard-image.ts—pwshfallback whenpowershell.exeis missing, normalized string output.cli/src/components/blocks/image-block.tsx,image-card.tsx— passmediaTypeto the renderer.terminal-images.test.ts(sequence conformance against the kitty spec),image-pipeline-integrity.test.ts(verifies image processing never corrupts payloads).test/setup-scm-loader.ts— no-op stub sobun testin theclipackage works in the public mirror (referenced bycli/bunfig.tomlbut missing from the public repo).Validation
bun run typecheck(cli) clean.Note
DeepSeek V4 Flash (the default model) is
multimodal: falseand reads images via the server-side describe pipeline — for best results with photos, use MiniMax M3 / GPT-5.6 Luna / MiMo 2.5.