Skip to content

fix(terminal): make text selections visible - #115

Merged
kbuffardi merged 3 commits into
mainfrom
fix/visible-terminal-selection
Oct 14, 2026
Merged

kbuffardi merged 3 commits into
mainfrom
fix/visible-terminal-selection

Conversation

@kbuffardi

@kbuffardi kbuffardi commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Repaint xterm's current selection range after selection changes, completed mouse drags, and theme changes so the active renderer paints selection foreground/background without clearing the range.
  • Add browser regression coverage using the real help output and CDP mouse drags; verify Monaco-computed colors, selected text, renderer geometry/foreground/background, inactive selection after blur, and screenshot pixel changes across all five themes.
  • Record the updated bug: invisible highlighting in light mode terminals #113 plan and diagnostic findings.

Validation

  • npm run lint
  • npm run build
  • npm run test:e2e (219 passing)
  • node --check scripts/smoke-browser.mjs
  • node scripts/smoke-browser.mjs chrome (passed in hosted fallback mode; Chrome for Testing did not load the unpacked extension)

Closes #113

Override xterm's black viewport default so uncovered space below the
terminal canvas uses the active terminal background. Add coverage for
all five themed viewport colors and record the #113 investigation plan.

Closes #113

Copy link
Copy Markdown
Owner Author

Update: fix the terminal black strip

Root cause: xterm’s bundled stylesheet hard-codes .xterm-viewport to black. When terminal rows do not fully occupy the viewport, the uncovered area becomes visible as a black strip—even before any selection occurs.

The fix adds a theme-specific --terminal-background token and applies it to xterm’s viewport. This matches the terminal canvas background in all five visual themes, including Light and High Contrast Light.

Added regression coverage to require the xterm viewport override and verify the expected terminal background sequence for all five themes.

Validation:

  • node --test scripts/e2e-settings-visual-theme.test.mjs
  • npm run lint
  • npm run build
  • npm run test:e2e (220 passing)

npm run test:browser:chrome completed its compiler preflight and seven compiler E2E cases, but the browser phase timed out waiting for Page.loadEventFired because the local x64 Chrome process is running under Rosetta. Debug logs show that environment-level launch/navigation failure rather than an app assertion.

Commit: 052db3a

Ensure the themed xterm viewport background overrides xterm's bundled
black default in the generated stylesheet.

Copy link
Copy Markdown
Owner Author

Follow-up correction: stylesheet order

The first viewport-background fix was present in source but ineffective in the built extension because app.js imported styles.css before xterm’s stylesheet. xterm’s later hard-coded .xterm-viewport { background-color: #000; } rule therefore won.

Commit 40201e6 reverses that import order, so the app’s theme-aware viewport rule is emitted after xterm’s default. The regression now verifies both the rule and stylesheet import order; the built CSS check confirms the override is last.

Validation:

  • npm run build
  • npm run lint
  • npm run test:e2e (220 passing)

@kbuffardi
kbuffardi merged commit b7cbf4f into main Oct 14, 2026
1 check passed
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.

bug: invisible highlighting in light mode terminals

1 participant