microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.51k stars 1.55k forks source link

FR: Colorized output #10890

Open H-G-Hristov opened 1 year ago

H-G-Hristov commented 1 year ago

Feature Request

If a compilation/execution in performed in the Terminal window the output is colorized. But for the compilation the output in "Output" is not. Interactive, colorized text in "Output" will be great.

Colengms commented 1 year ago

Hi @H-G-Hristov . Could you help me better understand the scenario you're referring to? Is a task.json generated by the C/C++ extension having its output directed to (a channel in) the Output panel? If so, could you confirm how that is occurring?

I believe the only compilation directly associated with the C/C++ extension is the command line generated into a tasks.json by the Debug/Run C++ File button. There, -fdiagnostics-color=always is added to colorize Terminal output (until https://github.com/microsoft/vscode-cpptools/issues/9681 is addressed, and node-pty can be used instead.)

Perhaps there is some settings I'm not finding? :)

H-G-Hristov commented 1 year ago

@Colengms I have Cmake project and when I build it from the CLI in the terminal I get nice colorised output as seen on the screenshot. If I build the same project configured with CMake presets form inside VSCode the output panel not only is showing big white letters (which is an issue with VSCode) but also the output is not colorised.

The colorised output makes it much easier to review the huge wall of text generated by the build system and the compiler. It would be great if the Output window provides such colorised output too.

Screenshot 2023-04-27 at 21 30 39 Screenshot 2023-04-27 at 21 30 11

Colengms commented 1 year ago

Hi @H-G-Hristov . Could you confirm the "output channel" that output is coming from?

image

I assume it must be coming from the CMake Tools extension (which owns the output channel "CMake/Build"). If so, you might consider opening the issue in the CMake Tools repo (or we can transfer this one). The C/C++ extension does not have any control over what is output to that channel.

H-G-Hristov commented 1 year ago

@Colengms Yes, you are absolutely right. I forget that cpptools and cmake-tools work together. I created a new FR: https://github.com/microsoft/vscode-cmake-tools/issues/3157

The same will be also useful in the C/C++ channel too.

Colengms commented 1 year ago

Hi @H-G-Hristov . Sounds good. We can use this issue as a feature request to track adding some color to the C/C++ output channel.

sean-mcmanus commented 1 year ago

@H-G-Hristov Also, if there was a particular subset of the C/C++ output channel that you wanted color for, we could potentially move that out to a separate panel (e.g. the raw clang-tidy output).

H-G-Hristov commented 1 year ago

@H-G-Hristov Also, if there was a particular subset of the C/C++ output channel that you wanted color for, we could potentially move that out to a separate panel (e.g. the raw clang-tidy output).

Thank you for asking. So I didn't have anything particular in mind but I can try explaining as an user from the tip of my head:

I am using the dark theme. A long wall of text, which needs to be scrolled, especially in a small panel, becomes hard for me to read and parse and I am missing details. What colorization and highlighting would do for me is to focus my attention on the important staff and to make the wall of text easer for my mind to parse. Colorization should be just about right. Too much can be also distracting. Stuff I'd prefer to see are "strings", "values", "links".

Also while it maybe useful to have all the output in the same place. There should be options to quickly switch between different outputs: compiler output, clang-tidy, cmake, etc. (specifically in the "Problems" panel).

All of this should apply to the different panels: "Problems", "Output", etc.

One particular issue that I see with "Output', which I guess is a VSCode issue but it doesn't get fixed, is that unlike the rest of the panels, the "Output" panel's font size is tied to the editor and changes if the editor's font size is changed. This is distracting in the sense that I'd like to have a larger font in the editor (as it gets larger screen estate) but smaller font size in the panel, so I can see more text in a smaller area.

sean-mcmanus commented 1 year ago

For the Problems panel, VS Code itself handles the filtering by the filter box in the top right and there is no API available to extensions to extend that.

The Outupt window font size is controlled by VS Code -- I thought

    "[output]": {
        "editor.fontSize": 6
    }

would work, but it is not, so you may want to file a bug report or feature request on them to enable that to work.

github-actions[bot] commented 1 year ago

This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog.

github-actions[bot] commented 4 months ago

This feature request has received enough votes to be added to our backlog.