Skip to content

Conversation

@ServeurpersoCom
Copy link

@ServeurpersoCom ServeurpersoCom commented Dec 7, 2025

Make sure to read the contributing guidelines before submitting a PR

Commit 1: Fix arrow keys on Windows

  • Windows VK_LEFT/RIGHT/UP/DOWN now map to private Unicode codepoints (U+E000-U+E003)
  • Same navigation logic for both Linux (ANSI escape sequences) and Windows (VK codes)
  • No more platform-specific handling in the main readline loop
  • Tested on Windows 11 with MSYS2/MinGW and Linux

Commit 2: Add Home/End support

  • Jump to line start/end with Home/End keys
  • Works on both platforms using the same private Unicode approach
  • Handles multiple Linux terminal Home/End variants (ESC[H, ESC[F, ESC[1~, ESC[7~, ESC[4~, ESC[8~)
    (Arrow keys already use standard VT100 sequences (ESC[A/B/C/D) across all terminals)

Commit 3: Add basic Up/Down history

  • Navigate previous commands with arrow keys
  • History persists during the session
  • Clearing and redrawing done with single write (optimized)
  • UTF-8 safe reconstruction of previous commands
Cross-CLI.mp4

Also OK also with native Visual Studio toolchain inside a cmd.exe
cmd

@coderabbitai
Copy link

coderabbitai bot commented Dec 7, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ngxson ngxson merged commit 88cd51d into ngxson:xsn/cli_arrow_left_right Dec 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants