Repository navigation
feat(terminal): honour transparent and blurred window backgrounds - #124
Merged
Merged
Conversation
Terminal mode ignored windowBackground: the terminal window always reported Opaque and dropped set_background_appearance. GPUI calls that right after opening a window, so the terminal window now stores the appearance and tells its renderer. - Transparent/Blurred: headless Metal clears to transparent (update_transparency), and each frame is converted from GPUI's premultiplied colour to the straight RGBA that kitty's f=32 images take. Before, 50% white reached the terminal as (128,128,128,128), a dark gray. - Opaque: the wgpu offscreen target always clears to transparent, so on Linux an opaque window leaked alpha. Its alpha is now forced to 255; the colour is already the scene over black, like a native opaque window. No escape code lets an app set a terminal's opacity or blur, so Blurred means the same as Transparent: a terminal configured with kitty background_blur or Ghostty background-blur shows the blurred wallpaper through the clear pixels. README documents the setup and the limits. Checked on Linux (wgpu, lavapipe) by decoding the first inline frame from a pty: blurred sends (255,255,255,128) for 50% white and (0,0,0,0) where unpainted; opaque sends (128,128,128,255) and (0,0,0,255). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PKVVkQhECMpqEZFEdCGjhc
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Terminal mode now respects
windowBackground: 'transparent' | 'blurred', so a terminal that has its own background opacity and blur shows the user's blurred wallpaper behind a GPUIX app.What changed
packages/gpui-terminal/src/window.rsonly, plus README and a changeset.TerminalWindowused to returnOpaquefrombackground_appearance()and ignoreset_background_appearance(). GPUI calls the setter right after it opens the window, so the window now stores the appearance and passes it to its renderer.update_transparency.f=32takes straight sRGB RGBA, sounpremultiplyconverts each frame before it is presented.No GPUI change was needed. The fix is in GPUIX's own
gpui_terminalcrate.Blur is the terminal's job
The kitty graphics protocol, kitty's OSC codes and Ghostty have no escape code that lets an app set opacity or blur. kitty can change opacity at runtime only through remote control or a shortcut, with
dynamic_background_opacity. So in a terminalblurredbehaves the same astransparent, and the blur comes from the terminal'sbackground_blur/background-blur. The README says so, and also notes that the protocol only promises alpha blending with the cells under the image. kitty appliesbackground_opacityonly to cells with the default background colour.Verification
On Linux (wgpu on lavapipe), in a pty, I decoded the first inline frame of a scene with the left half at 50% white and the right half unpainted:
128,128,128,128(too dark)0,0,0,0blurred255,255,255,1280,0,0,0opaque128,128,128,2550,0,0,255cargo testinpackages/gpui-terminalpasses (addsunpremultiplytests), andcargo test --libinpackages/nativepasses (285).Harness: Claude Code
Agent: none
Model: not written here; this harness does not put model ids in PR bodies
User prompts
review opened prs in last week. review them. find if they are worth merging. and align with this project philosophy and work. if some need changes appy changes and simplify. then merge to main. if they need changes or simplification apply them. if required apply changes to make testse passs in linux, etc
yes
see also now that we support blurring background for gpuix apps. can we support this also in terminal mode? for terminals that support blurred background themselves as well? so that we can see the backkground wallpaper of the user also via terminal. read if possible via the kitty graphics api. do this in another pr.
Generated by Claude Code