This repository was archived by the owner on Aug 27, 2025. It is now read-only.
Merged
Conversation
This is the first batch of changes from an upstream PR that provides UTF8 support. As a side effect, it means that we now will have the correct support for escape sequences in single and multiline mode. We previously merged in a smaller change which provided support for single line mode with escape sequences by fixing the cursor position but this is more comprehensive. The next commit will add the UTF8 library. Author: https://github.com/yhirose PR: antirez/linenoise#187
This is the second half of the PR that I'm merging in from upstream. It adds UTF8 13.0 support by including an extra library to get the char width of those characters (the visual width that is). During testing things seem to work quite well. I'm impressed. Author: https://github.com/yhirose PR: antirez/linenoise#187
Owner
Author
|
It looks like the old default version of |
Owner
Author
|
This should be good enough for now. I'll create an issue about finding an alternative for |
Owner
Author
|
@yhirose The original PR worked really well for adding UTF-8 support to Linenoise. Thanks! |
This was referenced Mar 17, 2024
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR pulls in UTF8 support from the antirez/linenoise#187 branch as a part of #21. So far so good but I want to update docs and do some more testing before merging.
It only covers unicode version 13.0 but that's way better than what it was before. In all likelihood I won't need the additional unicode characters that were added in 14.0 and 15.0 but I should document how this was generated as best as possible so that I could technically move to that in the future.
Anyway, I'm very impressed so far.
TODO:
Document process of generating the character widthsSee about updating tests to account for this UTF8 supportexpectthat supports UTF-8 and runs on CI