Color output in v2 now requires a tty?
Description
After updating to the latest gum v2 (installed via Homebrew), I noticed a change in behavior and I'd like to clarify if this was intentional or not. This is in bash 5.3.15 if it matters for the below examples. First, these commands work fine in both the old and new versions of gum:
gum style --foreground "#F00" hello
(gum style --foreground "#F00" hello)
They print "hello" in red text as expected. The following line has the same behavior in the previous version (gum v0.17.0), but since upgrading to v2, it now prints "hello" without color:
echo "$(gum style --foreground "#F00" hello)"
It appears that v2 doesn't print colors unless it detects a tty(?), but the older version didn't care. Relevant environment variables I have set:
COLORTERM=truecolor
TERM=xterm-256color
Was this intentional or is this a bug? If it's intentional, is there a way to tell gum to output color anyway? I didn't find anything in the documentation about enabling/disabling color output.
Version
v2.0.0
Environment
Ubuntu 20.04.6 / mobaxterm v25.0
Source: charmbracelet/gum