fix: ctrl-J is reported as KeyCR/KeyEnter on legacy terminals (fixes …#915
fix: ctrl-J is reported as KeyCR/KeyEnter on legacy terminals (fixes …#915
Conversation
WalkthroughInput handling now treats Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code graph analysis (1)input.go (1)
🔇 Additional comments (1)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #915 +/- ##
=======================================
Coverage 19.74% 19.74%
=======================================
Files 39 39
Lines 3404 3404
=======================================
Hits 672 672
Misses 2681 2681
Partials 51 51 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
input_test.go (1)
238-238: Consider renaming the test to reflect the corrected behavior.The test name
Enter_LFis misleading since LF (line feed) no longer producesKeyEnter. It now correctly producesKeyCtrlJwithModCtrl. A name likeLF_CtrlJwould be clearer.🔎 Suggested fix
- {"Enter_LF", '\n', KeyCtrlJ, ModCtrl}, + {"LF_CtrlJ", '\n', KeyCtrlJ, ModCtrl},
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
input.go(1 hunks)input_test.go(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
input_test.go (1)
key.go (2)
KeyCtrlJ(449-449)ModCtrl(318-318)
🔇 Additional comments (2)
input.go (1)
429-430: LGTM - CR/LF differentiation is now correct.The change correctly restores the distinction between carriage return (CR,
\r) and line feed (LF,\n). Only CR now maps to KeyEnter, while LF falls through to the default control character handling, which will transform it to KeyCtrlJ with ModCtrl. This fixes the regression and aligns with traditional terminal behavior.input_test.go (1)
534-534: LGTM - Test correctly validates the fix.The test expectation for newline now correctly expects
KeyCtrlJwithModCtrl, which aligns with the fix that differentiates LF from CR.
…911) This was a regression relative to 2.9.
0cb42b9 to
76abaa6
Compare
…#911)
This was a regression relative to 2.9.
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.