Skip to content

feat(terminal): background image behind terminal panes (#7714) - #15836

Closed
cunicopia-dev wants to merge 2 commits into
stablyai:mainfrom
cunicopia-dev:feat/terminal-background-image
Closed

cunicopia-dev wants to merge 2 commits into
stablyai:mainfrom
cunicopia-dev:feat/terminal-background-image

Conversation

@cunicopia-dev

Copy link
Copy Markdown

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

  • Settings: terminalBackgroundImage (inline data: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 shared sanitizeTerminalBackgroundImageSettings() in src/shared/terminal-background-image.ts.
  • Picker: new shell:pickTerminalBackgroundImage IPC (native dialog → size-capped data URL, 4 MB, png/jpeg/webp/gif), modelled on shell:pickRepoIconImage. Stored inline because the renderer can't load arbitrary file:// paths (webSecurity + repo-scoped fs auth) — same approach as repo icons.
  • Rendering: applyRootBackgroundImage() sets CSS variables + a host class on the pane-manager root; a ::before pseudo-element paints the image under every split as one continuous layer. No DOM node is inserted — equalizeManagedPaneSizes treats root.firstElementChild as the split tree, and dispose() wipes root.innerHTML, so a real element would be fragile.
  • xterm: while an image is set, allowTransparency is forced on and the per-pane theme background gets alpha 0 (RGB preserved so contrast math is unchanged). The published OSC 10/11 theme and minimumContrastRatio still use the opaque composed theme. With no image, behavior is byte-for-byte the same as before.
  • UI: TerminalBackgroundImageSetting under Appearance → Terminal → Advanced → Window, next to Background Opacity: thumbnail, Choose image… / Remove, opacity NumberField, fit SettingsSegmentedControl. Indexed in terminal-window-setup-search.ts; strings added to en.json via sync:localization-catalog.

Why

Requested in #7714 (and adjacent #15524). The Warp importer already detects background_image and 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, terminalBackgroundOpacity transparency handling) rather than adding a file protocol or new DOM structure.

Linked Issue

Fixes #7714

Visual Proof

Before (no image, unchanged behavior):

before

After — dark theme, cover, image pre-faded by the user:

after dark

After — light theme:

after light

Settings UI:

settings

(Screenshots live on an orphan pr-assets/* branch of my fork, not in this PR's files.)

Testing

  • macOS (arm64) only. pnpm dev with a Claude Code session running in a pane; set/changed/cleared the image via the Settings UI and via window.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 local build:mac package.

  • 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 a null-returning picker stub like pickRepoIconImage.

  • 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 in terminal-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: TerminalSettingsPreview owns 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

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: only data:image/* base64 payloads survive normalizeTerminalBackgroundImage (goes through validateRasterImageDataUri, plus a 6 MB length cap); the picker caps uploads at 4 MB and whitelists extensions/MIME types.
  • Performance: allowTransparency is only enabled while an image is set, matching the existing opacity path; the layer is a single ::before with pointer-events: none.
  • Backwards compatibility: all three settings are optional; absent keys mean no change in rendering.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

🤖 Generated with Claude Code

https://claude.ai/code/session_01RFaUth9uG7eet9wKhShwkg

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
@coderabbitai

coderabbitai Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 29e2a36c-6e89-4552-865c-6409a9c15e67

📥 Commits

Reviewing files that changed from the base of the PR and between 5b9bf3e and a7236a1.

📒 Files selected for processing (2)
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/en.json

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Adds 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 a7236

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.32% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 19 files. (1 skipped: 1 unsupported.) Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the terminal background-image feature and matches the primary change.
Description check ✅ Passed The description completes the required sections and documents behavior, testing, visual proof, limitations, and compatibility considerations.
Linked Issues check ✅ Passed The implementation satisfies the terminal-pane requirements in issue [#7714], including image selection, opacity, and all requested fit modes.
Out of Scope Changes check ✅ Passed The changes remain focused on terminal background images, including IPC, settings, rendering, localization, search, and automated tests.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 013eb53 and 5b9bf3e.

📒 Files selected for processing (20)
  • src/main/ipc/settings.ts
  • src/main/ipc/shell.ts
  • src/preload/api/shell-api.ts
  • src/preload/index.ts
  • src/renderer/src/assets/terminal.css
  • src/renderer/src/components/settings/TerminalBackgroundImageSetting.tsx
  • src/renderer/src/components/settings/TerminalWindowSection.tsx
  • src/renderer/src/components/settings/terminal-window-setup-search.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.test.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/pane-manager/pane-background-image.test.ts
  • src/renderer/src/lib/pane-manager/pane-background-image.ts
  • src/renderer/src/lib/pane-manager/pane-manager-types.ts
  • src/renderer/src/lib/pane-manager/pane-manager.ts
  • src/renderer/src/store/slices/settings.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/global-settings-types.ts
  • src/shared/terminal-background-image.test.ts
  • src/shared/terminal-background-image.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/renderer/src/i18n/locales/en.json Resolved
…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
@TobiasArg

Copy link
Copy Markdown

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

@novembrea

Copy link
Copy Markdown

Would really love to see that merged, staring at the terminal for hours every day, a little diversion for the eyes would be awesome.

@nwparker

nwparker commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by #36589: app themes can now set a background image with translucency, and #36796 shows it in native chat too. Thank you for this PR, it shaped the design.

@nwparker nwparker closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Feature Request: Support custom background images in the IDE

4 participants