Rendering ansi escape codes and output redirection #997
JacekArdanowski
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
|
@JacekArdanowski You can set |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I was just wondering if it's possible not to print ANSI escape characters when console output is being redirected to a file.
I'm thinking about special option which will prevent writing ANSI with:
app.exe > output.txtIn case of ordinary markup text: it is fine, because we can check the property
Console.IsOutputRedirectedand decide whether to use standard Console.Out, AnsiConsole.Markup() or even strip the markup from string.Although with AnsiConsole.Write(IRenderable) and output redirection, it is impossible to control this behaviour and output.txt will always have ANSI characters.
So my question is: is it possible to add a flag to AnsiConsole which won't produce any ANSI characters when output from console is being redirected? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions