Skip to content

fix(core): redraw reflowed prompt rows after a resize - #655

Open
vibhor-aggr wants to merge 1 commit into
bombshell-dev:mainfrom
vibhor-aggr:fix/redraw-resized-prompt
Open

vibhor-aggr wants to merge 1 commit into
bombshell-dev:mainfrom
vibhor-aggr:fix/redraw-resized-prompt

Conversation

@vibhor-aggr

Copy link
Copy Markdown

What does this PR do?

Fixes the visible stale header in #625. When narrowing a terminal wraps an already printed line, the renderer can no longer skip a common prefix by its old row number. It now clears the reflowed rows still in reach of the cursor and redraws the frame. When the printed lines still fit, it keeps the existing line diff. It does not try to clear scrollback.

On tmux 3.3a, I replayed the reporter's six-option prompt twice and compared it with fresh panes at the same selection. On main, two visible rows still contained the old hint at 40×30, both before and after Down. With this change every visible row matched at 40×30 and 80×24, and the scrollback counts stayed at 5 and 32. Separate runs checked preceding output, default tab stops, colored wide characters and joined emoji. I also replayed #577 and its merge base; their captures were identical for this sequence.

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 (underlying biome check --write on the changed TypeScript files)
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

Local verification: the core suite passed 194 tests; the prompts suite passed 639 with 4 Windows-only skips (Linux, Node 24.16.0, cached Vitest 3.2.6). The core TypeScript check and Biome 2.5.12 checks passed. I did not run the monorepo build.

AI-generated code disclosure

  • This PR includes AI-generated code

@changeset-bot

changeset-bot Bot commented Dec 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f0bbf66

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

This PR includes changesets to release 2 packages
Name Type
@clack/core Patch
@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

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