Skip to content

fix: black border around terminal on mobile (v0.4.7) - #181

Merged
gbasin merged 1 commit into
masterfrom
fix/mobile-terminal-border
Jul 30, 2026
Merged

fix: black border around terminal on mobile (v0.4.7)#181
gbasin merged 1 commit into
masterfrom
fix/mobile-terminal-border

Conversation

@gbasin

@gbasin gbasin commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Fixes the black border around the terminal view introduced by the xterm.js 6.0 upgrade in #180, reported on mobile Safari immediately after v0.4.6.

Root cause

Agentboard gives .xterm an 8px padding ring. Through xterm.js 5.5, the library painted .xterm-viewport (which spans the full box, padding included) with the theme background via an inline style on every theme change, so the ring matched the terminal (#2d2d2d). xterm.js 6.0's viewport rework applies the theme background to its new scrollable-element node instead — leaving the viewport with xterm.css's default background-color: #000. Result: an 8px pure-black frame around the terminal content, most visible on mobile where the terminal fills the screen.

Verified by DOM measurement under iPhone emulation: .xterm-viewport computed rgb(0,0,0) spanning 390×713 while .xterm-screen sat 8px inset painting the theme color.

Fix

  • styles/index.css: .xterm .xterm-viewport { background-color: transparent !important } — let the container show through.
  • Terminal.tsx: the terminal container div now carries terminalTheme.background (reactive to theme switches), so the padding ring always matches the terminal content.

After the fix, the same measurement shows the viewport transparent over a rgb(45,45,45) container, and the mobile screenshot renders edge-to-edge theme background with no border.

Notes

  • bun run lint && bun run typecheck && bun run test green.
  • Includes the version bump to 0.4.7 for release-on-merge.

xterm.js 6.0 stopped painting .xterm-viewport with the theme background
(5.5 set it inline on theme change; 6.0 themes the new scrollable-element
node instead), so xterm.css's default #000 showed through agentboard's 8px
.xterm padding — a black border around the terminal, most visible on
mobile. Make the viewport transparent and paint the terminal container
with the theme background so the padding ring always matches.
@gbasin
gbasin merged commit 7db78c0 into master Jul 30, 2026
6 checks passed
@gbasin
gbasin deleted the fix/mobile-terminal-border branch July 30, 2026 22:22
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.

1 participant