google / ansicolor-dart

Apache License 2.0
104 stars 26 forks source link

Not print with color in flutter #19

Closed DonsWayo closed 5 years ago

DonsWayo commented 5 years ago

Hi, I try to print with color in vs code and I only get a normal print color.

AnsiPen printRed = new AnsiPen()..red(bold: true); print(printRed("Bright white foreground") + " this text is default fg/bg");

Output: flutter: \^[[38;5;9mBright white foreground\^[[0m this text is default f<…>

zoechi commented 5 years ago

This looks like the console in VSCode doesn't interpret escape sequences

@DanTup ?

DanTup commented 5 years ago

Maybe a dupe of https://github.com/Dart-Code/Dart-Code/issues/1425. Some colours seem to work, some don't (this may be a limitation of the Debug Console in VS Code).

That said, I'm curious why @DonsWayo is seeing escape codes directly in the output. @DonsWayo do you have a screenshot of this? Is it the Debug Console you're seeing it in? Or is it test output in the Output window?

DonsWayo commented 5 years ago

Thanks for the quickly response, is on debug console, here is the screenshot errorprint

EDIT:

All the colours are the same (white) , no make sense change the color, can be conflicted with the theme on vscode?

DanTup commented 5 years ago

I'm just looking into why the escape codes are being printed, however even with that fixed I don't think the colours will work due to the bug linked above, which turns out to be a VS Code issue/limitation:

https://github.com/Microsoft/vscode/issues/67217

Please add a 👍 to that issue.

DanTup commented 5 years ago

Ok, the other issue seems to be specific to the iOS simulator. There's an open issue here:

https://github.com/flutter/flutter/issues/20663

I've added a comment with some screenshots here:

https://github.com/flutter/flutter/issues/20663#issuecomment-458071194

So this issue can probably be closed as a dupe of that (I don't have any powers here).

DonsWayo commented 5 years ago

Yes, this not a issue on the ansicolor-dart. Thank's for the feedback and I will use this logs only on android for now.