fix(init): fix only Enter working after legacy cleanup on Windows#1175
fix(init): fix only Enter working after legacy cleanup on Windows#1175showms wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesWelcome Screen Enter Key Refactoring
🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
alfred-openspec
left a comment
There was a problem hiding this comment.
Approved. This is the right fix shape: the welcome screen no longer mixes a raw stdin data listener between Inquirer prompts, and the focused regression plus my macOS PTY sanity check both pass.
Summary
Fix keyboard input becoming unresponsive during
openspec initon Windows after cleaning up legacy files.In the AI tool selection prompt, arrow keys, Space, and Backspace stop responding. Only Enter continues to work.
Reproduction
Run the following commands in PowerShell:
Then:
Upgrade and clean up legacy files.Select AI toolsprompt.Before this fix, only Enter responds.
Root Cause
The animated welcome screen manually managed stdin raw mode and listened for raw
dataevents between two Inquirer prompts.On Windows, this disrupted Inquirer's keypress handling for the following tool selection prompt.
Fix
Use an
@inquirer/coreprompt to wait for Enter on the welcome screen, keeping the complete interactive flow within Inquirer's input lifecycle.The existing animated welcome screen and Ctrl+C behavior are preserved.
Cross-platform impact
This change removes the welcome screen's manual raw stdin handling and uses an @inquirer/core prompt instead, so the welcome step now follows the same input lifecycle as the subsequent Inquirer prompts.
That keeps the fix platform-neutral rather than introducing Windows-specific logic, and should reduce the chance of terminal state inconsistencies across environments.
I reproduced the regression and verified the fix on Windows. I have not manually validated the interactive flow on a real macOS terminal, but the new implementation is more consistent with Inquirer's cross-platform input handling model.
Verification
pnpm run buildpnpm lintSummary by CodeRabbit