Skip to content

fix(prompts): overwrite active line on carriage-return updates in taskLog - #656

Open
a2499123744-del wants to merge 1 commit into
bombshell-dev:mainfrom
a2499123744-del:fix/task-log-carriage-return
Open

a2499123744-del wants to merge 1 commit into
bombshell-dev:mainfrom
a2499123744-del:fix/task-log-carriage-return

Conversation

@a2499123744-del

Copy link
Copy Markdown

What does this PR do?

Fixes taskLog handling of carriage-return (\r) spinner and progress updates so intermediate frames overwrite the active line in place rather than accumulating in the buffer and corrupting line-erase height calculations:

  • Track per-buffer line cursor state (lines, full, lineOpen, pendingCR) in packages/prompts/src/task-log.ts instead of concatenating raw strings into a single value string with a shared closure-level lastMessageWasRaw flag.
  • Handle standalone \r (both leading \rframe and trailing frame\r), standard \r\n, and chunk-split '\r' + '\n' sequences without dropping preceding lines or leaking overwritten frames into error() / success() / retainLog output.
  • Compute terminal line wrap height using visible width (fast-string-width) and current terminal columns (getColumns(output)) so ANSI SGR codes and overwritten frames never inflate erase.lines(...).
  • Add unit and snapshot tests covering \r, \r\n, chunk-split CRLF, non-raw carriage returns, wrapped frame overwrites, limit + retainLog, and multi-group state isolation.

Closes #510

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@changeset-bot

changeset-bot Bot commented Dec 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d4b0fe4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clack/prompts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the automated PR author detected as automated label Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Automation signals

@a2499123744-del Activity patterns show signs of automation.

Classification: automation (score: 30)

Signal Points Detail
Severe fork surge +70 26 repositories forked in rapid succession (within 24 hours)

Analyzed 53 public events via @unveil/identity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated PR author detected as automated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] taskLog does not correctly handle carriage-return spinner/progress output

1 participant