Repository navigation
feat(terminal): background image behind terminal panes (#7714) - #15836
cunicopia-dev wants to merge 2 commits into
Conversation
Adds terminalBackgroundImage / terminalBackgroundImageOpacity / terminalBackgroundImageFit settings, a native image picker that stores the image as a size-capped data URL, and a ::before image layer on the pane-manager root. xterm switches to a transparent fill only while an image is set so the root's theme color and the image composite beneath it; clearing the image restores the opaque fill exactly as before. Settings UI lives under Appearance > Terminal > Advanced > Window (thumbnail, Choose/Remove, opacity, Cover/Contain/Stretch/Center fit) and is indexed for settings search. Closes stablyai#7714 Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RFaUth9uG7eet9wKhShwkg
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughAdds terminal background image settings with shared validation, opacity and fit normalization, and CSS resolution. Adds desktop and web image selection APIs. Renders the image behind terminal panes with transparency and configurable styling. Adds controls to select, preview, remove, and configure the image, with search entries and English localization. Adds tests for normalization, pane styling, and terminal appearance behavior. Merge Risk: 🔵 Low · up to If a terminal opens before settings finish loading, a saved background image may fail to appear in that pane until it is recreated. The change is otherwise mergeable with explicit owner awareness of this startup-order follow-up. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 072c63d5-a01c-4b70-8786-54c75ce2f960
📒 Files selected for processing (20)
src/main/ipc/settings.tssrc/main/ipc/shell.tssrc/preload/api/shell-api.tssrc/preload/index.tssrc/renderer/src/assets/terminal.csssrc/renderer/src/components/settings/TerminalBackgroundImageSetting.tsxsrc/renderer/src/components/settings/TerminalWindowSection.tsxsrc/renderer/src/components/settings/terminal-window-setup-search.tssrc/renderer/src/components/terminal-pane/terminal-appearance.test.tssrc/renderer/src/components/terminal-pane/terminal-appearance.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/pane-manager/pane-background-image.test.tssrc/renderer/src/lib/pane-manager/pane-background-image.tssrc/renderer/src/lib/pane-manager/pane-manager-types.tssrc/renderer/src/lib/pane-manager/pane-manager.tssrc/renderer/src/store/slices/settings.tssrc/renderer/src/web/web-preload-api.tssrc/shared/global-settings-types.tssrc/shared/terminal-background-image.test.tssrc/shared/terminal-background-image.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
…arch keyword strings Review follow-up: pass the resolved allowTransparency into the initial xterm options so new panes never depend on the post-open toggle, and add the image/wallpaper/picture keyword entries to en.json. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RFaUth9uG7eet9wKhShwkg
|
Hey, any updates on this? I’ve been using Orca every day and would genuinely love to see this feature land. I actually looked around to see if anyone was already working on it before asking for it—and found this PR! Just one user eagerly waiting over here |
|
Would really love to see that merged, staring at the terminal for hours every day, a little diversion for the eyes would be awesome. |
ELI5
You can now pick a picture and Orca draws it faintly behind every terminal pane — like a wallpaper for your terminals. Opacity and fit are adjustable, and removing it puts everything back exactly how it was.
What Changed
terminalBackgroundImage(inlinedata:image/*URL),terminalBackgroundImageOpacity(0–1, default 0.15),terminalBackgroundImageFit(cover|contain|stretch|center). Sanitized in main (ipc/settings.ts), the renderer store, and the web client mirror via one sharedsanitizeTerminalBackgroundImageSettings()insrc/shared/terminal-background-image.ts.shell:pickTerminalBackgroundImageIPC (native dialog → size-capped data URL, 4 MB, png/jpeg/webp/gif), modelled onshell:pickRepoIconImage. Stored inline because the renderer can't load arbitraryfile://paths (webSecurity + repo-scoped fs auth) — same approach as repo icons.applyRootBackgroundImage()sets CSS variables + a host class on the pane-manager root; a::beforepseudo-element paints the image under every split as one continuous layer. No DOM node is inserted —equalizeManagedPaneSizestreatsroot.firstElementChildas the split tree, anddispose()wipesroot.innerHTML, so a real element would be fragile.allowTransparencyis forced on and the per-pane theme background gets alpha 0 (RGB preserved so contrast math is unchanged). The published OSC 10/11 theme andminimumContrastRatiostill use the opaque composed theme. With no image, behavior is byte-for-byte the same as before.TerminalBackgroundImageSettingunder Appearance → Terminal → Advanced → Window, next to Background Opacity: thumbnail, Choose image… / Remove, opacityNumberField, fitSettingsSegmentedControl. Indexed interminal-window-setup-search.ts; strings added toen.jsonviasync:localization-catalog.Why
Requested in #7714 (and adjacent #15524). The Warp importer already detects
background_imageand reports it as unsupported, so the intent existed — this adds the rendering path and a first-class setting. The data-URL + CSS-variable design keeps the change inside existing patterns (repo-icon storage,PaneStyleOptions→setPaneStyleOptions,terminalBackgroundOpacitytransparency handling) rather than adding a file protocol or new DOM structure.Linked Issue
Fixes #7714
Visual Proof
Before (no image, unchanged behavior):
After — dark theme,
cover, image pre-faded by the user:After — light theme:
Settings UI:
(Screenshots live on an orphan
pr-assets/*branch of my fork, not in this PR's files.)Testing
macOS (arm64) only.
pnpm devwith a Claude Code session running in a pane; set/changed/cleared the image via the Settings UI and viawindow.api.settings.set, toggled light/dark, resized, split panes — image stays one continuous layer across splits, text contrast unaffected, clearing restores the opaque xterm fill. Also produced a localbuild:macpackage.Not tested on Linux / Windows / SSH. Nothing here is platform- or host-specific: the picker is Electron's
dialog.showOpenDialog(already used by the sibling handlers), rendering is CSS, and the setting is client-side appearance state so remote hosts are unaffected. Web client gets the same normalization and anull-returning picker stub likepickRepoIconImage.Automated:
src/shared/terminal-background-image.test.ts(normalizers, fit→CSS, sanitizer),pane-background-image.test.ts(root CSS vars / class apply & clear), and new cases interminal-appearance.test.ts(transparency + transparent fill with image, opaque fill without).pnpm typecheck,oxlint,verify:localization-*,check:max-lines-ratchet, and the affected vitest projects pass locally.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Known limitation / follow-up:
TerminalSettingsPreviewowns its own xterm instance and does not yet show the image behind the preview. Kept out of this PR to keep the diff focused; happy to add it as a follow-up.AI Disclosure
Implemented with Claude Code (Claude Fable 5) driving the exploration, implementation, and Playwright-over-CDP validation; reviewed and directed by me.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
data:image/*base64 payloads survivenormalizeTerminalBackgroundImage(goes throughvalidateRasterImageDataUri, plus a 6 MB length cap); the picker caps uploads at 4 MB and whitelists extensions/MIME types.allowTransparencyis only enabled while an image is set, matching the existing opacity path; the layer is a single::beforewithpointer-events: none.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code
https://claude.ai/code/session_01RFaUth9uG7eet9wKhShwkg