Repository navigation
ellipsis_truncate: pad a truncated string to the full width (1.4-maint) - #10481
Merged
ThomasWaldmann merged 1 commit intoOct 3, 2026
Merged
ThomasWaldmann merged 1 commit into
ThomasWaldmann merged 1 commit into
Conversation
swidth_slice does not split a wide (e.g. CJK) character, so each of the two slices around the "..." can be one cell short of its width. The truncated result was then up to 2 cells narrower than the space, and nothing padded it. borg create --progress and borg extract --progress repaint their line with a carriage return and rely on the padding to overwrite the previous line: with wide characters in the paths, the last characters of a longer previous line stayed visible. Backport of borgbackup#10480. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.4-maint #10481 +/- ##
=============================================
- Coverage 82.11% 82.10% -0.01%
=============================================
Files 38 38
Lines 11479 11480 +1
Branches 1808 1808
=============================================
Hits 9426 9426
- Misses 1467 1468 +1
Partials 586 586 ☔ View full report in Codecov by Harness. |
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.
Description
Backport of #10480.
ellipsis_truncate()pads a short string to the given width, but it did not pad a truncated one.swidth_slice()does not split a wide (e.g. CJK) character, so each of the two slices around the...can be one cell short, and the truncated result could be up to 2 cells narrower than requested.borg create --progressandborg extract --progress(which usesellipsis_truncate()inProgressIndicatorPercenton 1.4) repaint their line with a carriage return and rely on that padding to overwrite the previous line. With wide characters in the paths, the end of a longer previous line stayed visible, e.g.pwide/日...い名前_2.txtt.The truncated string is now padded like the short one.
Checklist
master(or maintenance branch if only applicable there)toxor the relevant test subset)🤖 Generated with Claude Code