Rendering ansi escape codes and output redirection #997
JacekArdanowski
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
@JacekArdanowski You can set |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.txt
In case of ordinary markup text: it is fine, because we can check the property
Console.IsOutputRedirected
and 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