Skip to content

Improve xterm.js terminal quality#6

Open
ssv445 wants to merge 2 commits intomainfrom
feat/xterm-improvements
Open

Improve xterm.js terminal quality#6
ssv445 wants to merge 2 commits intomainfrom
feat/xterm-improvements

Conversation

@ssv445
Copy link
Copy Markdown
Owner

@ssv445 ssv445 commented Feb 8, 2026

Summary

  • CanvasAddon for GPU-accelerated rendering (graceful fallback on unsupported devices)
  • SearchAddon with Cmd/Ctrl+Shift+F to search terminal buffer (Enter/Shift+Enter for next/prev)
  • Double-paste fix via isPastingRef — prevents text sent twice when both paste event and onData fire
  • Cmd/Ctrl+C copies selected text instead of sending SIGINT (passes through when no selection)
  • Better resize: ResizeObserver + visualViewport + screen.orientation + debounced double-fit
  • No padding on terminal div — fixes FitAddon dimension mismatch (padding included in offsetHeight but xterm renders inside padding box)
  • Scroll-to-bottom floating button when scrolled up in buffer
  • Improved terminal options: bar cursor, 15k scrollback, smooth scroll, adaptive font size (11/14px), line height (1.15/1.2)

Patterns learned from QuivrHQ/247-claude-code-remote.

Test plan

  • Open a terminal session, verify canvas rendering (check DevTools console for no CanvasAddon errors)
  • Paste text — verify it appears once, not duplicated
  • Select text + Cmd/Ctrl+C — verify it copies (not SIGINT). Without selection, verify ^C works
  • Cmd/Ctrl+Shift+F — verify search bar opens, type to search, Enter/Shift+Enter for nav, Escape to close
  • Scroll up in terminal — verify floating down-arrow button appears, click to scroll back
  • Resize browser window / toggle DevTools — verify terminal refits cleanly
  • Test on mobile (or DevTools mobile mode) — verify smaller font, higher scroll sensitivity
  • Open iOS PWA — verify orientation change triggers refit

Closes #5

🤖 Generated with Claude Code

ssv445 and others added 2 commits February 8, 2026 09:46
…esize

- Add CanvasAddon for GPU-accelerated rendering (with fallback)
- Add SearchAddon with Cmd/Ctrl+Shift+F to search terminal buffer
- Fix double-paste bug via isPastingRef flag on native paste events
- Cmd/Ctrl+C now copies selected text instead of sending SIGINT
- Better resize handling: ResizeObserver, visualViewport, orientation
- Double-fit pattern to handle stale computed styles after layout
- Remove padding from terminal div (FitAddon dimension mismatch fix)
- Scroll-to-bottom floating button when scrolled up in buffer
- Improved terminal options: bar cursor, 15k scrollback, smooth scroll
- Adaptive font size (11px mobile, 14px desktop) and line height

Closes #5

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ling

- Throttle setIsAtBottom via requestAnimationFrame (perf: avoid re-renders on every scroll/write)
- Fix search effect infinite loop risk: inline search call, remove findNext from deps
- Try-catch around SearchAddon calls (can fail on malformed input or after dispose)
- Clipboard writeText in Ctrl+C handler: add .catch() so failure doesn't swallow SIGINT
- Use openSearch() in keyboard handler instead of duplicating logic (was dead code)
- Add .catch() to cleanup promise to handle init() rejection on unmount

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Improve xterm.js terminal: canvas addon, paste fix, copy, resize, search, mobile

1 participant