fix: Vendor single-line-log to fix terminal line-wrapping bug#2652
fix: Vendor single-line-log to fix terminal line-wrapping bug#2652luismulinari wants to merge 1 commit intotrunkfrom
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
The @wwa/single-line-log package is unmaintained and contains a bug that causes line clearing to fail when output wraps across multiple physical terminal lines, resulting in stacked output. This change vendors the fixed version locally with the fix from freeall/single-line-log#21, which uses '\r' instead of '\x1b[1000D' for cursor positioning to ensure consistent behavior across all terminal emulators. Changes: - Remove @wwa/single-line-log dependency - Add src/lib/cli/single-log-line.ts with MIT license preserved - Update all imports to use local implementation - Add string-width@8.1.0 as direct dependency Related PR: - freeall/single-line-log#21
b65ca44 to
3560df5
Compare
|
| } as LogFunction; | ||
|
|
||
| log.clear = function () { | ||
| stream.write( '\n' ); |
This is the standard ANSI sequence that actually works on most terminals. The only case when it does not work is when the line exceeds 1000 characters. But I do agree that the
Are you joking? It is freeall/single-line-log that is unmaintained. freeall/single-line-log#15 was the reason to replace that package. |
|
Updated in #2653 |
@sjinks, this is tricky, actually. Even if the line doesn't exceed 1000 characters, it breaks for some terminals (e.g. |
Ohhh, I'm sorry. For some reason, I missed the fork! BTW, thanks for maintaining that! Closing the PR in favor of #2653 |



Description
Fixes a terminal display bug where progress indicators and single-line logs would stack vertically instead of updating in place when the output exceeded terminal width. This occurred because the upstream
@wwa/single-line-logpackage is unmaintained and contains a cursor positioning bug.Problem
The
@wwa/single-line-logpackage uses an ANSI escape sequence (\x1b[1000D) that doesn't work correctly on most terminals when output wraps across multiple physical lines.Solution
This PR vendors a fixed version of
single-line-loglocally with the fix from freeall/single-line-log#21, which replaces the problematic ANSI sequence with a carriage return (\r) for reliable cursor positioning across all terminal emulators.Changes
@wwa/single-line-logdependencysrc/lib/cli/single-log-line.tswith MIT license preservedsrc/bin/vip-sync.jssrc/lib/cli/progress.tssrc/lib/media-import/progress.tssrc/lib/validations/sql.tsstring-width@8.1.0as direct dependencyReferences
Changelog Description
Fixed
Pull request checklist
New release checklist
Steps to Test
Outline the steps to test and verify the PR here.
Example:
npm run build./dist/bin/vip-cookies.js nom