Repository navigation
Conversation
Solve an issue where CJK characters are not being rendered with correct width while tab completion is cycling multiple results, caused by reusing a buffer without resetting lead/trail attribute. Also add UTF-8 to checking list since it contains CJK characters.
|
kwkam Thanks for your contribution! Please follow the requirements of PR Checklist. |
|
kwkam - This might be fixed in the PSReadLine repo. You can install v2 from the gallery. I think the version in this repo will be removed in favor of pulling my version from the gallery, so if you still see issues, I suggest you submit a PR there instead. The change to |
|
Jason Shirk (@lzybkr) - Sorry I didn't know PSReadLine is an external module and yes the issue is fixed in upstream. |
LengthInBufferCells should compute the real string length
| escapeSequenceAdjustment += ControlSequenceLength(str, ref i); | ||
| } | ||
| } | ||
| #if !UNIX |
There was a problem hiding this comment.
Isn't this a problem on Linux/Mac as well?
There was a problem hiding this comment.
I suppose but I cannot test.
Is there any reason why the LengthInBufferCells function is disabled on unix?
There was a problem hiding this comment.
I don't know for sure, but I would guess the original code depended on Windows apis and when porting to non-Windows, they punted on porting that code until a later time.
There was a problem hiding this comment.
Exlcuding LengthInBufferCells from that block since it seems to be harmless.
This reverts commit 36634be.
|
This PR has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs within 10 days. |
|
This PR has be automatically close because it is stale. If you wish to continue working on the PR, please first update the PR, then reopen it. |
PR Summary
Compute display width for the string in
LengthInBufferCells, otherwiseFormat-TableandFormat-Widewill pad unnecessary space for CJK character.Add UTF-8 to checking list since it contains CJK characters.
PR Checklist
Note: Please mark anything not applicable to this PR
NA.NAUser facing Documentation neededNAIssue filed - Issue link:NAAdd[feature]if the change is significant or affectes feature testsWIP:to the beginning of the title and remove the prefix when the PR is ready.