Repository navigation
Fix doubled keystrokes in the apply form after a resize - #146
Merged
Merged
Conversation
Opening the form via a deep link (/#apply-1) and then changing the terminal width reran `apply`: runDeepLink's replay only skipped `tui`, not the rest of NO_REPLAY. The second form's input listener stacked on the first, so every character was echoed twice. Also redraw the pending form question and typed text after a resize, instead of a shell prompt that hid the still-active form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
An applicant reported that the terminal application's name field "kept duplicating characters."
To reproduce: open
/#apply-1, start typing a name, then change the terminal width (resize the window or rotate a phone). Every key after that is echoed twice; typing "Doe" showsDDooee.Cause
A width change wipes the terminal and replays history. History replay skips interactive commands (
NO_REPLAY), but deep links aren't in history, andrunDeepLink({ replay: true })only skippedtui. So the resize started a secondapplyform, and itsonDatalistener stacked on the live one.Fix
runDeepLinknow skips everyNO_REPLAYcommand on replay.collectInputrecords its pending question interm.activeInput. After a resize,resizeListenerredraws that question and the text typed so far. Before, it drew a shell prompt while keystrokes still went into the form.Testing
tests/terminal-ext.test.js. Both failed before the change;npm testpasses (457).apply 1. After a resize, typing isn't doubled and the screen showsWhat's your name?: Jane Doe. The form was cancelled each time, not submitted.🤖 Generated with Claude Code