Repository navigation
Preserve display cells and control policies when clipping cursor movement - #427
Closed
civilwarinfrance wants to merge 1 commit into
Closed
civilwarinfrance wants to merge 1 commit into
civilwarinfrance wants to merge 1 commit into
Conversation
Owner
|
Thanks for both |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #427 +/- ##
==========================================
- Coverage 97.74% 97.64% -0.10%
==========================================
Files 13 13
Lines 4118 4118
Branches 696 696
==========================================
- Hits 4025 4021 -4
- Misses 71 73 +2
- Partials 22 24 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
|
I'll bring this up to date in another branch/PR thanks |
rahul05ranjan
pushed a commit
to rahul05ranjan/blessed
that referenced
this pull request
Nov 14, 2026
This follows up jquast#427, simplifying it a bit, it's something I missed in wcwidth integration jquast#420. It's also not necessarily a "bugfix" but rather an "improvement" in performance. The call to `padd()` is removed, which was originally done as a hack to replace tabs or "cursor right" `\x1b[10C` to spaces, `' '*10`, and only so that it would be easily measured or truncated Closes jquast#427.
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.
Terminal.clip()andtruncate()can delete untouched text when the input moves the cursor left. For example,term.clip('abc\x1b[2DX')returnsaXinstead ofaXc. Preprocessing withSequence.padd()slices Unicode codepoints rather than display cells, so it also mishandles backspaces into combining characters and wide graphemes. The preprocessing removes cursor controls beforecontrol_codes='ignore'or'strict'can handle them.Pass the original
Sequencetowcwidth.clip(), which already resolves horizontal cursor movement and the requested control-code policy. Update the API descriptions and changelog. This is separate from the per-cell SGR issue in jquast/wcwidth#305: these regressions pass with released wcwidth 0.9.4 and the existing minimum 0.9.2, without a dependency change.Validation:
TEST_QUICK=0 TEST_KEYBOARD=1: 1,985 passed, 53 skipped. All 79 sequence tests pass with both wcwidth 0.9.4 and 0.9.2.AI assistance was used to investigate, implement and test this change.