Repository navigation
fix: respect the prompt output stream width - #630
Merged
43081j merged 1 commit intoOct 29, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: e20263f The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
commit: |
43081j
approved these changes
Oct 29, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fix prompt wrapping and clearing when the prompt is written to a different output stream from stdout.
For example,
text({ output: process.stderr, ... })on a 40-column terminal leaves part of the previous question on screen when stdout is piped. The prompt currently measures both frames againstprocess.stdout.columns, even though it writes to stderr. UsinggetColumns(this.output)in both places keeps rendering and cursor restoration consistent with the stream receiving the prompt.The two regression cases fail before the fix. I also checked the built prompt in a real 40-column PTY with stdout piped: typing
abcand cancelling leaves two copies of the question before this change and one afterwards. The narrow-output snapshots now include wrapped help text and its extra cursor row.There is no linked issue for this specific case; this is a small correction to the existing custom-output option. It does not attempt to fix terminal resizing in general.
Type of change
Validation
With Node 24.22.1 and pnpm 10.33.0,
pnpm testpasses: 173 core tests and 628 prompts tests, with 4 existing skips.pnpm format,pnpm lint,pnpm types, andpnpm depspass.I also ran the full suite on the pinned Node 20.18.1. It has four
note.test.tscolor snapshot failures; a separate checkout of unchanged main produces the same four failures. Both new regressions pass on Node 20, and no note snapshots were changed.GitHub's build, types, tests, dependency checks, and preview also pass. The separate Detect Agent workflow fails during
npm install --prefix automationwithCannot read properties of null (reading 'edgesOut'), before it runs detection.Checklist
pnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure