Open MrStevns opened 3 weeks ago
I've been aware of this since the rewrite. This happens with any core:log
interface that redirects a console logger, because the logger's created assuming it can use color output, then it's redirected and that may not be the case anymore. It's an issue that will require more OS-specific terminal-aware functionality.
You can mitigate some of this by using -define:ODIN_TEST_FANCY=false
to disable the animation though, which will keep from printing the progress bar lines.
The compiler has this piece of code to determine if it should do colors, is this a good idea to port over and use here? https://github.com/odin-lang/Odin/blob/f49ebae9562257effe014e3c175496915041d5f2/src/main.cpp#L2860-L2905
isatty
and GetConsoleMode
are the OS parts needed I mentioned. Checking the TERM
string and the environment variables is good. I think this could do it.
Context
When using
odin test
where the output is not printed to a terminal but say the output window in Sublime Text or in my case, Focus, the output is unnecessarily messy. It would be nice if we could ignore the ANSI escape codes or have a flag to disable them.Odin report
Expected Behavior
When building a project from either Sublime text or Focus, or any other non tty output, i'd expect something like this:
Current Behavior
Where as right now the output is this.
Steps to Reproduce
To Reproduce
> odin test /path/to/project/
Additional notes
I started out making this a Focus editor issue but as the maintainer responded, shouldn't this be handled by Odin?