Repository navigation
fix: copy and paste in the serial terminal - #10
Merged
Merged
Conversation
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
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
onDatato the port and nothing ever wrote the selection to the clipboard.A small
clipboardKeyHandleris attached withattachCustomKeyEventHandler. It follows the SSH terminal's defaults (default-copy-ctrlshiftcand paste): Ctrl+Shift+C copies the selection and clears it, and Ctrl+Shift+V pastes throughterminal.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.