Skip to content

Fix CI logs appending instead of updating in place#21

Merged
selfcontained merged 1 commit into
mainfrom
fix/ci-log-append
Mar 10, 2026
Merged

Fix CI logs appending instead of updating in place#21
selfcontained merged 1 commit into
mainfrom
fix/ci-log-append

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • gh run watch uses ANSI cursor-up escape sequences (ESC[<N>A) to redraw its multi-line status block in-place. The previous \r carriage-return fix only handled single-line replacement, so each 3-second refresh appended the entire block again.
  • Added rewindReleaseLog() + stripAnsi() in the backend streamProcess to detect cursor-up sequences and remove stale lines before appending the new block
  • Added log.rewind event type so the frontend slices off the old lines in sync

Test plan

  • test/stream-process.test.ts exercises the fix with a mock script that mimics gh run watch ANSI output — confirms 9 final log lines instead of 27 (3× appended)
  • Visual verification during next release that the CI log panel updates in place

🤖 Generated with Claude Code

`gh run watch` uses ANSI cursor-up sequences (ESC[<N>A) to redraw its
multi-line status block. The previous fix only handled carriage returns
(\r) for single-line replacement, so each refresh appended the entire
block again.

- Detect ESC[<N>A cursor-up sequences in streamProcess and rewind the
  log by N lines before appending the new block
- Strip ANSI escape sequences from log output for clean display
- Add log.rewind event type so the frontend removes stale lines
- Include test with mock gh-run-watch script to validate behavior

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@selfcontained
selfcontained merged commit aa116be into main Mar 10, 2026
1 check passed
@selfcontained
selfcontained deleted the fix/ci-log-append branch March 10, 2026 20:54
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