Skip to content

fix(terminal): use ClipboardAddon for copy-on-select - #264

Merged
levi770 merged 1 commit into
mainfrom
fix/terminal-clipboard-addon
Jun 8, 2026
Merged

fix(terminal): use ClipboardAddon for copy-on-select#264
levi770 merged 1 commit into
mainfrom
fix/terminal-clipboard-addon

Conversation

@levi770

@levi770 levi770 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Install @xterm/addon-clipboard
  • Replace removed copyOnSelect: true option with ClipboardAddon in Terminal.tsx and OutputPanel.tsx

Root cause

copyOnSelect was removed in xterm.js v5 (@xterm/xterm). The option is silently ignored — that's why the previous PR #263 had no effect. The correct API is @xterm/addon-clipboard which uses the browser Clipboard API.

Test plan

  • Select text in the interactive terminal — text copies to clipboard on mouse release
  • Select text in the output panel — same behavior

Generated by Mistaber Code — Computational Halacha Encoding Agent

copyOnSelect option was removed in xterm.js v5. The correct
replacement is @xterm/addon-clipboard which handles clipboard
integration via the Clipboard API. Adds the addon to both the
interactive terminal and the read-only output panel.

Co-authored-by: Mistaber Code <code@mistaber.ai>
Copilot AI review requested due to automatic review settings June 8, 2026 09:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Verdict: CHANGES REQUESTED
Counts: [CRITICAL] 2 · [IMPORTANT] 0 · [NIT] 0
Scope detected: platform
Highlights:

  • ClipboardAddon does not implement copy-on-select by itself, so the intended UX change won’t work in Terminal.tsx.
  • Same issue in OutputPanel.tsx; selection still won’t auto-copy without an explicit selection handler.

This PR aims to restore “copy selected terminal text to clipboard” behavior after copyOnSelect was removed/ignored in newer xterm.js, by adding @xterm/addon-clipboard and wiring it into the interactive terminal and output panel.

Changes:

  • Add @xterm/addon-clipboard dependency.
  • Load ClipboardAddon in Terminal.tsx and OutputPanel.tsx after removing the deprecated copyOnSelect option.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
dashboard/frontend/src/components/Terminal/Terminal.tsx Removes deprecated copyOnSelect and loads ClipboardAddon in the interactive terminal.
dashboard/frontend/src/components/BottomPanel/OutputPanel.tsx Same migration for the read-only output terminal.
dashboard/frontend/package.json Adds @xterm/addon-clipboard dependency.
dashboard/frontend/package-lock.json Updates lockfile for the new dependency (and associated metadata normalization).
Files not reviewed (1)
  • dashboard/frontend/package-lock.json: Language not supported

Comment on lines 117 to +120
const fitAddon = new FitAddon();
term.loadAddon(fitAddon);
term.loadAddon(new WebLinksAddon());
term.loadAddon(new ClipboardAddon());
Comment on lines 125 to 128
const fitAddon = new FitAddon();
term.loadAddon(fitAddon);
term.loadAddon(new ClipboardAddon());
term.loadAddon(new WebLinksAddon());
@levi770
levi770 merged commit b50bf33 into main Jun 8, 2026
8 checks 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.

2 participants