You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Color codes in error messages are probably escaped when using the iOS simulator #20663
P3Issues that are less important to the Flutter projectcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team
I'm adding ANSI color codes such as \u001B[31;1m (bright red) to error messages.
They render fine when using the Android emulator.
But with the iOS simulator, they seem to get escaped and appear as below: **\^[[31;1m**Material widget ancestor required by TextField widgets not found.**<…>**
Reacted by Jacob Richman, Daniel Richards, lwky, nr152522, jamieastley, tigranhov, Eric, Anton Emmerik, Robin, abin-saju and 48 more
changed the title [-]Color codes in error messages are probably escaped when using the iOS simulator[/-][+]Color codes in error messages are escaped when using the iOS simulator[/+]on Aug 15, 2018
The color codes also get displayed in the form of weird characters in the red box (and text wraps at the edge of the screen instead of the edge of the red box – this is an unrelated "bug").
Also, the debugWordWrap function in /lib/src/foundation/print.dart will need to be updated to ignore color codes (when wrapping strings that are wider than the width of the terminal).
changed the title [-]Color codes in error messages are escaped when using the iOS simulator[/-][+]Color codes in error messages are probably escaped when using the iOS simulator[/+]on Aug 20, 2018
Hi, I'm seeing the same issues (color works when running a real wirelessly-connected iphone, but not when running with iOS simulator). I don't see any resolution in all linked issues. I wonder if this is still on track to be investigated/fixed?
Unfortunately I'm considering it very unlikely that this will be fixed - which is sad, as having the ability to add color to debug output (especially when running in the simulator) would greatly help in complex projects...:(
P3Issues that are less important to the Flutter projectcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team
Activity
[-]Color codes in error messages are probably escaped when using the iOS simulator[/-][+]Color codes in error messages are escaped when using the iOS simulator[/+]kandarpksk commentedon Aug 15, 2018
The color codes also get displayed in the form of weird characters in the red box (and text wraps at the edge of the screen instead of the edge of the red box – this is an unrelated "bug").
kandarpksk commentedon Aug 18, 2018
Also, the
debugWordWrapfunction in/lib/src/foundation/print.dartwill need to be updated to ignore color codes (when wrapping strings that are wider than the width of the terminal).jacob314 commentedon Aug 20, 2018
@pq who is working on logging with the Flutter IntelliJ plugin. It would be nice for that logging to also respect color escape codes.
[-]Color codes in error messages are escaped when using the iOS simulator[/-][+]Color codes in error messages are probably escaped when using the iOS simulator[/+]zoechi commentedon Aug 21, 2018
I think @devoncarew
kandarpksk commentedon Aug 21, 2018
Attempted fixes for some of the other bugs mentioned:
master...kandarpksk:colored_messages
This is a demo app (click on the first button to recreate the sample error):
https://github.com/kandarpksk/buggy
pq commentedon Aug 21, 2018
Thanks for this @kandarpksk. Great motivation!
jacob314 commentedon Aug 21, 2018
DanTup commentedon Jan 28, 2019
This came up at google/ansicolor-dart#19 too.
Given this code:
Running
flutter runfrom the terminal looks like this from an Android device:But like this with the iOS Simulator (I don't have an iPhone to test there):
dan-rds commentedon May 24, 2019
ionutholbia commentedon Jul 4, 2019
mkoorn commentedon Jul 12, 2019
watching this issue too. for now I prefix my logging with emoji ℹ️✅⛔️🤮
31 remaining items
incrediblezayed commentedon Nov 9, 2024
nateshmbhat commentedon Dec 8, 2024
jdeepwell commentedon Dec 8, 2024
Hannnes1 commentedon Dec 10, 2024
Adding my comment from #64491, so that it doesn't get lost:
So the issue isn't limited to the iOS simulator.
yanqianglu commentedon Jul 17, 2025
Hi, I'm seeing the same issues (color works when running a real wirelessly-connected iphone, but not when running with iOS simulator). I don't see any resolution in all linked issues. I wonder if this is still on track to be investigated/fixed?
jdeepwell commentedon Jul 19, 2025
I also searched all over the net - nothing.
All reports I found are closed
#28856
#13204
Unfortunately I'm considering it very unlikely that this will be fixed - which is sad, as having the ability to add color to debug output (especially when running in the simulator) would greatly help in complex projects...:(
mocki-toki commentedon Aug 18, 2025
I regret that this issue hasn’t received attention from the Flutter team, as it seriously affects the convenience of debugging applications.
If you need colored logs, I can suggest a workaround I found:
In this case, colors are displayed correctly, but hot restart only works through the terminal.
JoakoV3 commentedon Oct 8, 2025
Any updates on this issue?
jubr commentedon Apr 30, 2026
Any updates on this in 2026? 🙏
fix(log): never emit colour on iOS, where it cannot survive
feat(log): colour the log in the terminal, where ANSI works
docs: link the upstream iOS issue
khusantoy commentedon Sep 8, 2026
Experiencing the exact same behavior in 2026. Subscribing to this issue for updates—hope the PR fix gets merged soon!
erlangparasu commentedon Sep 9, 2026