Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
web-serial-plotter | 9428dab | Commit Preview URL Branch Preview URL |
Oct 01 2025, 09:39 PM |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for sending CTRL-C and CTRL-D control characters in the serial console interface. It introduces both keyboard shortcuts and dedicated UI buttons for these commonly used terminal control commands.
- Adds keyboard shortcuts (Ctrl-C and Ctrl-D) that are intercepted and sent as control characters
- Implements UI buttons for sending CTRL-C (interrupt) and CTRL-D (EOF) commands
- Updates message handling logic to properly format and log control characters
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/components/SerialConsole.tsx | Updates message handling to detect and properly format control characters without adding newlines |
| src/components/ConsoleInput.tsx | Adds keyboard event handling, control character buttons, and updated placeholder text |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| // Log outgoing message with readable name for control chars | ||
| if (isControlChar) { | ||
| const code = message.charCodeAt(0) |
There was a problem hiding this comment.
The control character name generation logic uses a magic number (64) without explanation. Consider adding a comment explaining that this converts ASCII control codes to their corresponding caret notation (e.g., code 3 becomes '^C' via String.fromCharCode(64 + 3) = '@' + 3 = 'C').
| const code = message.charCodeAt(0) | |
| const code = message.charCodeAt(0) | |
| // The magic number 64 converts ASCII control codes to caret notation (e.g., code 3 becomes '^C' via String.fromCharCode(64 + 3) = 'C') |
Summary
Adds buttons for sending CTRL-C and CTRL-D
Motivation & Context
Closes #13
Changes
Adds buttons for sending these codes
Screenshots / Demos (if UI)
How to Test
Checklist
npm run lintand fixed any issuesnpm run typecheck(TypeScript) with no errorsnpm testand tests passnpm run test:coverageif code paths changed significantlyAdditional Notes