fix(terminal): avoid duplicate broadcast keypress text - #3292
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex reported no major issues. This PR is marked ready for human review/merge. |
Summary
Typing uppercase letters and spaces with cross-tab broadcast enabled could send some characters twice to recipient terminals while the source looked correct. Preserve the physical-key pairing when xterm emits its text on
keypress, and prevent a trailinginsertTextmarker from treating the next physical key as a second composition commit.Type of Change
Related Issue (optional)
Found while smoke testing #3275 in the development app. No separate issue.
Changes Made
keypress; retain the existing unmatched-event cleanup so later paste is not swallowed.Screenshots / Demo
Verified in the actual
npm run devElectron UI on macOS, with local zsh and a Linux SSH session:echo NETCATTY_SMOKE_BROADCAST_20260906_Alooks correct on the source, but recipients repeat uppercase characters. Individual Shift+A/B/C producesABBCat the recipient.insertText; the next physical A arrives before the composition fallback timer expires and is broadcast again as text.ABC.echo "中文 ABC paste"still reaches the recipient correctly and produces the expected text once.Temporary diagnostic recording was removed before final verification.
Testing
npm run devand Computer UI actionsnpm run lintpasses; final changed files also pass focused lintnpm test: 11,484 passed, 18 skipped, zero failures118 focused keyboard, broadcast, IME, and terminal tests pass. The baseline fails six delayed-keypress regression cases; the intermediate timing repair still fails the captured trailing-insertText case (
AABBCCinstead ofABC). The final change passes all nine new cases, including keyless Chinese text and subsequent paste.Checklist