emeraldwalk / vscode-runonsave

Visual Studio Code extension to run commands whenever a file is saved.
Apache License 2.0
182 stars 57 forks source link

colorization #61

Open tansaku opened 3 years ago

tansaku commented 3 years ago

Great plugin - but when I see the output in the output console I don't get the colorization I get in my terminal or the ability to click through on file paths - do I need to load my .zshrc or something?

hlindberg commented 2 years ago

I run validation logic on save of certain files with Run on Save. The output from my validator has color turned on even when output is not a tty. Colored output is important to users as it can otherwise be difficult to visually parse the output.

What happens now:

When output appears colors are stripped

What is expected:

Coloured output from the command is shown in the Output for Run on Save.

According to this article: https://stackoverflow.com/questions/57940666/how-can-i-get-colored-output-in-vs-code-output-window color coded output is determined by the extension that manages the Output, so it does not seem like I can do anything about this via configuration.

Nathaniel-Letourneau commented 1 week ago

Would love colorization as well. I just set it up to run clang-tidy on save, and parsing warnings without colors is kind of a bummer.

bmingles commented 1 week ago

@Nathaniel-Letourneau can you provide an example of the error output that needs colorization (preferably as text instead of screenshot) ?

Nathaniel-Letourneau commented 1 week ago

@bmingles Here is an output with colorization for clang-tidy :

Formatting [1/1] c:\Users\nathaniel_letourneau\Documents\sbq-atmel-embedded\nv_mag_app\src\operation\heartbeat\led_blinker.c
Running clang tidy on c:\Users\nathaniel_letourneau\Documents\sbq-atmel-embedded\nv_mag_app\src\operation\heartbeat\led_blinker.c...
15785 warnings generated.
warning: macro replacement list should be enclosed in parentheses [bugprone-macro-parentheses]
C:\Users\nathaniel_letourneau\Documents\sbq-atmel-embedded\nv_mag_app\src\operation\heartbeat\led_blinker.c:23:36: warning: parameter 'unused_parameter_a' is unused [misc-unused-parameters]
   23 | static void _daemon_callback(void* unused_parameter_a, uint32_t unused_parameter_b) {
      |                                    ^
C:\Users\nathaniel_letourneau\Documents\sbq-atmel-embedded\nv_mag_app\src\operation\heartbeat\led_blinker.c:23:65: warning: parameter 'unused_parameter_b' is unused [misc-unused-parameters]
   23 | static void _daemon_callback(void* unused_parameter_a, uint32_t unused_parameter_b) {
      |                                                                 ^
C:\Users\nathaniel_letourneau\Documents\sbq-atmel-embedded\nv_mag_app\src\operation\heartbeat\led_blinker.c:27:1: warning: parameter 'free_rtos_timer' is unused [misc-unused-parameters]
   27 | define_timer_callback(_daemon_callback);
      | ^
C:\Users\nathaniel_letourneau\Documents\sbq-atmel-embedded\freertos_dependencies\include/freertos_dependencies/software_timer_rtos.h:30:47: note: expanded from macro 'define_timer_callback'
   30 |     static void _timer_callback(TimerHandle_t free_rtos_timer) {                                                                                                                                       \
      |                                               ^
Suppressed 15781 warnings (15780 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

The question marks are actually esc characters in my terminal : image

The expected output would look like this : image