Skip to content

Fix AnsiLogObserver sticky message duplication on line wrap#6852

Merged
pditommaso merged 1 commit intomasterfrom
fix/ansi-log-sticky-wrap
Feb 22, 2026
Merged

Fix AnsiLogObserver sticky message duplication on line wrap#6852
pditommaso merged 1 commit intomasterfrom
fix/ansi-log-sticky-wrap

Conversation

@pditommaso
Copy link
Member

Summary

  • Fix ANSI progress rendering bug where sticky messages (and other long messages) were duplicated when they wrapped past the terminal width
  • The line counter now accounts for visual line wrapping by calculating ceil(visualLength / cols) per line, after stripping ANSI escape codes
  • Added countVisualLines(), stripAnsi() methods and corresponding tests

Test plan

  • Existing AnsiLogObserverTest tests pass
  • New tests for stripAnsi and countVisualLines with various wrapping scenarios
  • Manual verification with narrow terminal and long sticky messages

🤖 Generated with Claude Code

Account for terminal line wrapping when counting visual lines in the
ANSI progress renderer. Previously only explicit newlines were counted,
causing cursorUp to undershoot when messages exceeded terminal width.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@netlify
Copy link

netlify bot commented Feb 22, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit f41b7e0
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/699b4bedda533f0008ef34cf

@pditommaso pditommaso merged commit 4a06f70 into master Feb 22, 2026
11 checks passed
@pditommaso pditommaso deleted the fix/ansi-log-sticky-wrap branch February 22, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant