Repository navigation
Fix input loss with Unicode initial text - #302
Merged
djc merged 1 commit intoOct 17, 2026
Merged
Conversation
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.
read_line_initial_textcounts the initial text in UTF-8 bytes but stores input asVec<char>. With aλprefix, typingabcreturnsbc; longer multibyte prefixes can discard the entire response. The same mismatch affects the Backspace boundary.Use the length of the collected character buffer for both operations, preserving the existing read-only prefix behavior.
Add a Linux/macOS pseudo-terminal regression test that exercises the public method with ASCII, Greek, emoji, CJK and combining prefixes, Unicode typed input, an empty prefix, and Backspace at the prefix boundary. The test fails on the original code (
bcversusabc) and passes with this fix. It uses the existing libc dependency.Validation:
make check, all sevenmake testconfigurations,make lint,make format-check, andmake docpassed.27442a22ec39bc280a77d814c5a678b24610ba6b, covering the upstream workflow matrix: MSRV 1.71, Windows/macOS/Linux, WASM/WASI, beta/nightly, Clippy, rustfmt and minimal versions. The untouched target commit also passed 20/20 jobs. The interactive regression runs on Linux/macOS; other targets retain their existing checks.Fixes #301.