Open slmjkdbtl opened 6 years ago
Currently Cargo doesn't do detection to see whether the shell supports colors, it simply checks $TERM != "dumb"
and whether the output is a tty, and if both of those are true it emits colors.
Could vim be configured to set TERM=dumb
if it doesn't support ansi codes?
+1
At this point, we check
Note: this is using anstyle-query
and matches termcolor
s behavior with the last two items which is what ripgrep uses
Looking at another crate, supports-color
, instead of assuming any terminal supports color if it isn't TERM=dumb
, it checks a specific list of term values / prefixes. As t his whole area is a hodgepodge, its hard to tell what is the most appropriate route to take.
Hmm, I just did !echo $TERM
and I got back the result for my own terminal which means we don't have anything to go off of. This was with vim 8.2.213.
Is there anything we can even do for this? Are there examples of other programs that work better with vim that we could learn from?
btw we also have #11211 for changing TERM
detection
the ansi escape characters are not omitted, while other programs with color output works fine?