Color detection mechanism does not work if stdout is piped #662
-
I'm trying to build an fzf like cli: the tui output a string to stdout, which is piped to another command. In order to achieve it, use the However, when using this command, the color is not detected properly: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, you can solve this by forcing a color profile with |
Beta Was this translation helpful? Give feedback.
Hi, you can solve this by forcing a color profile with
lipgloss.SetColorProfile(int)
.There are 4 modes available, 0:TrueColor, 1:ANSI256, 2:ANSI, 3:Ascii.
This isn't a bug, moreover a precaution the
termenv
lib takes to avoid writing escape sequences when 'not' outputting to a TTY.