Skip to content

fix: copy and paste in the serial terminal - #10

Merged
LukeGus merged 1 commit into
Termix-SSH:dev-1.1.0from
ZacharyZcR:fix/serial-copy-paste
Nov 16, 2026
Merged

LukeGus merged 1 commit into
Termix-SSH:dev-1.1.0from
ZacharyZcR:fix/serial-copy-paste

Conversation

@ZacharyZcR

Copy link
Copy Markdown
Member

Fixes #2: in the desktop app, text selected in a serial session can't be copied. Ctrl+C goes to the device as ^C (correct for a terminal), and Ctrl+Shift+C and the context menu do nothing.

The xterm instance had no key handling of its own, so every key went through onData to the port and nothing ever wrote the selection to the clipboard.

A small clipboardKeyHandler is attached with attachCustomKeyEventHandler. It follows the SSH terminal's defaults (default-copy-ctrlshiftc and paste): Ctrl+Shift+C copies the selection and clears it, and Ctrl+Shift+V pastes through terminal.paste, so the text reaches the port like typed input. Cmd+C / Cmd+V do the same on macOS. Ctrl+C, plain keys and everything else still go to the device. This is the approach suggested in the issue. Right-click copy and copy-on-select from the SSH terminal are not included.

Validation: new tests cover copy with both shortcuts (including clearing the selection), paste, and Ctrl+C and plain keys left to the device. All 16 plugin tests, typecheck, build, manifest validation and prettier pass. Not tried in the desktop app with a real serial device.

Every key went to the port, so nothing could copy a selection: Ctrl+C is
the device's, and in the desktop app nothing else reaches the clipboard.

Ctrl+Shift+C / Ctrl+Shift+V (Cmd+C / Cmd+V on macOS) now copy the selection
and paste, as in the SSH terminal. Other keys still go to the port.

Fixes Termix-SSH#2
@termix-triage-bot

Copy link
Copy Markdown

AI review | Looks safe to merge

Adds a custom key event handler to enable Ctrl+Shift+C/Cmd+C copy and Ctrl+Shift+V/Cmd+V paste in the serial terminal, correctly intercepting these shortcuts while passing all other keys to the device. Includes unit tests and follows plugin standards.

Reviewed 47eeffc. AI can be wrong, a maintainer still decides. Comment /termix review to run it again.

@LukeGus LukeGus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@LukeGus
LukeGus merged commit 34ee95c into Termix-SSH:dev-1.1.0 Nov 16, 2026
6 of 7 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