Skip to content

fix: stop the terminal's last row clipping under pane padding - #147

Merged
gsvprharsha merged 2 commits into
tempestai-dev:mainfrom
lvanhouten:fix/terminal-fit-padding
Oct 20, 2026
Merged

gsvprharsha merged 2 commits into
tempestai-dev:mainfrom
lvanhouten:fix/terminal-fit-padding

Conversation

@lvanhouten

Copy link
Copy Markdown
Contributor

FitAddon sizes rows and cols from the computed height and width of xterm's parent element. .terminal-pane is border-box with 8px padding, so those values included 16px the terminal could not use. Fit could then add a row that overflowed the pane and got cut off at the bottom, plus up to two columns past the right edge.

Use an 8px margin instead of padding so fit measures only the space xterm can draw in. The gutter looks the same.

What changed

Two CSS changes in TerminalPane.css that fix how the terminal fills its pane:

  1. .terminal-pane: padding: 8px → margin: 8px. FitAddon sizes rows and columns from the computed border-box of xterm's parent. With box-sizing: border-box and padding, that counted 16px the terminal couldn't use, so fit often added a row that overflowed the pane and was clipped at the bottom, plus up to two columns past the right edge. A margin keeps the same gutter while fit measures only the space xterm can draw in.

  2. .xterm-viewport background → var(--tempest-bg-editor). xterm.css paints .xterm-viewport #000, and xterm 6 applies the theme background only to the scrollable element that spans the rows. Rows rarely fill the pane exactly, so a strip up to one row high is left below the last row. Without the overflowing row from (1) covering it, that strip showed as a black bar. The viewport now uses the same color as the terminal theme, so it follows theme changes.

Splitting the gutter between padding and margin doesn't avoid either problem. Over 60 pane heights, padding: 4px; margin: 4px clipped the last row at 16 and showed the black strip at 24, so both changes are needed.

Related issue

N/A

How was this tested

  • Harness (xterm 6.0.0 + addon-fit 0.11.0, same DOM and CSS as TerminalPane), across 60 pane heights:

    Last row clipped Black strip below last row
    Before 32 / 60 (up to 8px) -
    After 0 / 60 0 / 60

    Column count also drops from 81 to 79, the correct value.

  • Same harness in Playwright WebKit 26.6 (the macOS engine family): identical results.

  • Installed build on Windows 11: Claude Code's bottom status line, which used to be half cut off, now renders fully, with no bar below it.

image

Checklist

  • npx tsc --noEmit passes
  • cargo check passes (if backend changed) - N/A, CSS only
  • I've tested this on my OS — noted which: Windows 11
  • Docs updated if user-facing behaviour changed - N/A
  • No secrets, tokens, or personal paths in the diff

lvanhouten and others added 2 commits October 19, 2026 11:19
FitAddon sizes rows and cols from the computed height and width of
xterm's parent element. .terminal-pane is border-box with 8px padding, so
those values included 16px the terminal could not use. Fit could then add
a row that overflowed the pane and got cut off at the bottom, plus up to
two columns past the right edge.

Use an 8px margin instead of padding so fit measures only the space xterm
can draw in. The gutter looks the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xterm.css sets .xterm-viewport to #000, and xterm 6 applies the theme
background only to the scrollable element that spans the rows. Rows
rarely fill the pane exactly, so the leftover strip (up to one row high)
below the last row showed as a black bar. Give the viewport the same
--tempest-bg-editor color the terminal theme uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@lvanhouten is attempting to deploy a commit to the Tempest OSS Team on Vercel.

A member of the Team first needs to authorize it.

@gsvprharsha
gsvprharsha merged commit 1c9abef into tempestai-dev:main Oct 20, 2026
1 check failed
@gsvprharsha

Copy link
Copy Markdown
Collaborator

@lvanhouten Thank you so much for the PR. We have merged it into the main branch

@lvanhouten
lvanhouten deleted the fix/terminal-fit-padding branch October 20, 2026 20:31
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.

2 participants