-
-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ANSI support for output #2199
Conversation
Alternative configuration using
@nohwnd @beatcracker @briantist Thoughts? Overcomplicating it? 😄 |
I like the options as you have them laid out here. It doesn't seem overcomplicated to me, it seems thorough and well thought out. I didn't know about no-color and I think it's a nice idea and should be supported. |
The options seem more straightforward to me, if we add a "conflicting" FQFQ (or whatever) output option in the future, we don't have to solve what happens where there are both UseAnsi and UseFQFQ. The breaking change: Is writing via console directly necessary to implement this? Or is that just for perf? |
Perf. Regain the delay added by wrapper (and more). I'm considering replacing option Then custom PSHosts could still use the information-output, even though it's still broken regarding |
Printing 1000 lines with ForegroundColor (average of 5 runs)
We got 5x lines in pipeline, so ~2sec test-time per runner maybe. Maybe not worth it?
I'm fine either way, just thought we already had gotten some feedback on output being slow 🙂 The difference was bigger last year when I tried to support array-input to fix the broken information-stream at the same time. |
I think sticking with Write-Host is the right thing to do here, even though it is a bit slower. |
Ready for review. Good thing we squash commits. 😄 Let me know if I should rebase |
Really nice, some small suggestions. |
Merged, thanks for that. |
Thanks! Finally done with this conflict-magnet 😄 🎉 |
PR Summary
Introduces a configuration option
Output.RenderMode
and a wrapper-function to replaceWrite-Host
so we can output strings using ANSI-escaped sequences to get colors in CI or plaintext etc. The option supports the following levels:The new function
Write-PesterHostMessage
supports all parameters ofWrite-Host
to make it an easy replacement.Fix #1953
TODO:
Write-PesterHostMessage
PR Checklist
Create Pull Request
to mark it as a draft. PR can be markedReady for review
when it's ready.