Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: Colors not working #18

Closed
g0dzillaa opened this issue Apr 15, 2023 · 11 comments
Closed

iOS: Colors not working #18

g0dzillaa opened this issue Apr 15, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@g0dzillaa
Copy link

I was trying to understand why colors are not supported in VSCode and read the comment in the ReadMe.md

Please note that all IDEs (VSCode, XCode, Android Studio, IntelliJ) do not support ANSI escape sequences in their terminal outputs. These escape sequences are used to color output. If using such an IDE do not configure colored output.

However, one of the dev_dependencies that I am using is working perfectly with colors!

Any idea why this is not working for main project?

This is the dev dependency: https://pub.dev/packages/pubspec_dependency_sorter

Screenshot 2023-04-15 at 11 54 28 PM

@Bungeefan
Copy link
Member

Did you try the logger color output in your VSCode?
I am using Android Studio and can confirm that it indeed does work in the IDE, I am guessing this was true in the past or for specific versions.

@g0dzillaa
Copy link
Author

@Bungeefan I am not sure how to do that. What I meant was, it is working fine for a dev dependency but not in the main dependency.

@Bungeefan
Copy link
Member

I was trying to find out if you only assumed that it doesn't work because of the (possibly old) comment in the README, or if you really tried it in your VSCode, and it didn't work?

@Bungeefan Bungeefan changed the title Colors working on certain packages in VSCode Colors not working on certain packages in VSCode Apr 25, 2023
@Bungeefan Bungeefan added the bug Something isn't working label Apr 25, 2023
@g0dzillaa
Copy link
Author

@Bungeefan I did try and I can confirm that this is the case. I added the dev dependency lately and figured that for some reasons, the colors are working there!

Happy to help with any additional information that help debug this but I think if you just install the https://pub.dev/packages/pubspec_dependency_sorter dev package on an flutter project, you can easily find the difference.

@Bungeefan
Copy link
Member

Bungeefan commented May 6, 2023

Sorry for the slow replies, I haven't had as much time lately as I would have liked.

Anyways, I installed VS Code and tried to replicate your problem.
I tried the following:

  • Start a debug session via the UI
  • Run flutter run
  • Added pubspec_dependency_sorter as dev_dependency and run dart run

In all three instances, the colors of the logger packages were fully working for me.
In the first case I looked in the debug console in VS Code and in the other two I used the terminal provided by VS Code.

Settings that I used:
Besides some non-important settings from VS Code (like keyboard layout) these were the only settings defined in my settings.json. Which were automatically applied by the Dart plugin when using "Use recommended settings".

    "[dart]": {
        "editor.formatOnSave": true,
        "editor.formatOnType": true,
        "editor.rulers": [
            80
        ],
        "editor.selectionHighlight": false,
        "editor.suggest.snippetsPreventQuickSuggestions": false,
        "editor.suggestSelection": "first",
        "editor.tabCompletion": "onlySnippets",
        "editor.wordBasedSuggestions": false
    },

Launch config:

        {
            "name": "test",
            "request": "launch",
            "type": "dart"
        },

I tested this on a Linux machine and couldn't identify any problems, especially with any colors.
Additionally, a colleague of mine uses VS Code on Windows and also had no problems with the colors of this package.

@Bungeefan
Copy link
Member

@g0dzillaa Are you by any chance using macOS?
I was able to test the colors on a recent version of macOS and summarized my findings in the README (d672c9c).

@g0dzillaa
Copy link
Author

Hey @Bungeefan,

Yes, I am using macOS. It's interesting that the dev dependencies work without a problem and they are consistent too.

@Bungeefan Bungeefan changed the title Colors not working on certain packages in VSCode iOS: Colors not working Jun 12, 2023
@Bungeefan
Copy link
Member

@g0dzillaa Now that I think about it, it makes perfect sense. xD

dev_dependecies are executed using dart run, therefore they run under the OS of your development device, not your mobile device.
On the opposite, Flutter (with all of your dependencies) runs on the deployed device (like in your case an iOS device) and the flutter bug seems to break the colors when streaming the log output from an iOS device.
Therefore, the iOS color bug does not affect your dev dependency running under macOS.

As this is not a logger bug, I am going to go ahead and close this issue now.
If you disagree, just ping me and I will reopen it.

@Bungeefan Bungeefan pinned this issue Jun 12, 2023
@g0dzillaa
Copy link
Author

Thanks. That makes sense to me. Do you have any links to the flutter issue?

@Bungeefan
Copy link
Member

Oh sorry, sure, it was linked in the README: flutter/flutter#64491

@BenjiFarquhar
Copy link

Pretty good workaround until the bug is fixed: flutter/flutter#64491 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants