Fix Enter key omitting the selected serial line ending - #52
Open
CAOShurong wants to merge 2 commits into
Open
Conversation
CAOShurong
marked this pull request as ready for review
August 9, 2026 02:18
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 #46.
The issue report by @grbl-IO correctly identified that the Enter handler called
sendTextwith only the text, while the Send button also passedinput.endlineToSend. This makes both paths call the same function with the same two arguments, so devices requiring CR, LF, or CRLF receive the configured ending regardless of how the command is submitted.Validation:
npm --prefix server testcovers both template handlers and the CRLF, LF, CR, and empty-ending conversions without adding dependencies. The same test passes with Node 14.21.3 on Windows x64 and Ubuntu 24.04 WSL2 x64.sendToSerialmessages with no page or console errors.DataInputSerial.jsandvscode/src/extension.ts, then used SerialPort 10.5.0's mock binding to record the final bytes written bySerialPort.write. Windows and Linux Node 14 runs matched byte-for-byte for CRLF, LF, CR, empty ending, terminator-only, and UTF-8 payload cases.node14-windows-x64; the generated executable started and served the same verified UI path.SerialPort.list()found no active Windows port on the validation host, so no physical-device claim is made; the serial-library boundary was validated with its official mock binding.