Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

aiorepl: Fix Enter key handling in raw terminal mode#1016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
andrewleech wants to merge1 commit intomicropython:master
base:master
Choose a base branch
Loading
fromandrewleech:fix-aiorepl-raw-terminal

Conversation

@andrewleech
Copy link
Contributor

Summary

Fix aiorepl to properly handle the Enter key when stdin is in raw terminal mode by accepting both CR (0x0D) and LF (0x0A) for command execution.

Problem

When using aiorepl with MicroPython ports that put stdin in raw mode (such as the updated unix port using pyexec), the Enter key sends CR (0x0D) instead of LF (0x0A). The original aiorepl only handled LF, requiring users to use Ctrl+Enter instead of Enter to execute commands.

Solution

  • Handle both CR (0x0D) and LF (0x0A) for command execution
  • Improve handling of various newline sequences (CRLF, double-LF, double-CR) to prevent double-execution
  • Preserve original behavior in paste mode

Test plan

  • Verify Enter key now executes commands in raw terminal mode
  • Verify CRLF sequences don't cause double-execution
  • Verify paste mode still works correctly
  • Test with unix MicroPython port using new pyexec REPL

🤖 Generated withClaude Code

Handle both CR (0x0D) and LF (0x0A) for command execution to ensurecompatibility with raw terminal mode where Enter sends CR instead of LF.This fixes the issue where aiorepl required Ctrl+Enter instead ofjust Enter to execute commands when used with MicroPython ports thatput stdin in raw mode (such as the updated unix port using pyexec).Also improves handling of various newline sequences (CRLF, double-LF,double-CR) to prevent double-execution of commands.🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@andrewleech@pi-anl

[8]ページ先頭

©2009-2025 Movatter.jp