fix: reset ANSI styling before printing prompt #992
Merged
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.
Summary
Reset any ANSI styling that may have been left by external commands before printing the prompt. This ensures the prompt is not affected by previous output styling that was not properly reset.
Problem
When external commands output text with ANSI styling but don't include a reset sequence, the styling continues to affect the prompt display. This was reported in nushell/nushell#16384.
Solution
Added ANSI reset (
SetAttribute(Attribute::Reset)andResetColor) at the beginning ofrepaint_buffer()function to ensure any leftover styling is cleared before the prompt is rendered.Test Plan
Fixes nushell/nushell#16384