task icon indicating copy to clipboard operation
task copied to clipboard

Support for prefixes with colored output

Open nicheceviche opened this issue 5 months ago • 4 comments

Description

Summary

Currently, task output supports either prefixes (showing task names like [server], [styles], etc.) OR colored output, but not both simultaneously. This forces users to choose between task identification and helpful color coding.

Current Behavior

  • With prefixes enabled: Output shows helpful task identification but loses color information
  • Without prefixes: Output has useful colors (particularly for HTTP requests, status codes, etc.) but it's difficult to identify which task generated which output

Requested Feature

Allow both prefixes and colored output to work together, so users can have:

  • Task name prefixes for easy identification of output sources
  • Colored output for better readability (HTTP status codes, file types, etc.)

Screenshots of current behavior

With prefixes (current): Image

Without prefixes (current): Image

nicheceviche avatar Jul 13 '25 21:07 nicheceviche

Hello! I’m not sure what you’re using, but it looks like colors are disabled because it detects that we’re not writing directly to stdout, but rather to a buffer.

For example, with this Taskfile, it works as expected:

version: '3'

tasks:
  test-colors:
    desc: Test different color outputs
    cmds:
      - echo "Test basique sans couleur"
      - echo -e "\033[31mTexte rouge\033[0m"
      - echo -e "\033[32mTexte vert\033[0m"
      - echo -e "\033[33mTexte jaune\033[0m"
      - echo -e "\033[34mTexte bleu\033[0m"
      - echo -e "\033[35mTexte magenta\033[0m"
      - echo -e "\033[36mTexte cyan\033[0m"
      - echo -e "\033[1;31mTexte rouge gras\033[0m"
      - echo -e "\033[4;32mTexte vert souligné\033[0m"
Image

Can you try setting the environment variable FORCE_COLOR=1? With Vite, it works for me.

Image

vmaerten avatar Aug 25 '25 19:08 vmaerten

@vmaerten thanks for your reply!

You're right, this totally works for Vite! But it doesn't seem to work for my other processes, including Air, the tailwindcss cli, and templ.

nicheceviche avatar Aug 25 '25 21:08 nicheceviche

I haven't test for others but it seems to work with tailwindcss :

Image

vmaerten avatar Aug 26 '25 07:08 vmaerten

@nicheceviche did you solve your problem with this? AFAICS it is working, right?

trulede avatar Dec 08 '25 22:12 trulede