Open rchl opened 9 months ago
Would love this. lefthook
gets run in vim-fugitive
and prints out color codes. It would be nice to auto-detect non-interactive terminals and disable color.
Currently I have to disable color everywhere if I want readable output in vim
.
:zap: Summary
It would be nice to have an "auto" value (or similar) for the
colors
option so that colors are automatically toggled based on the terminal's support for escape sequences.I don't know that much about terminals to suggest the BEST solution here but I would think that there is some convention that programs use for detecting whether the terminal supports colors. For example using the
TERM
orCOLORTERM
env variables. For example my zsh terminal reports:while my git software that doesn't support escape sequences reports:
Value
Since the hooks are invoked by git, it's currently not possible to vary the
color
state based on whether the hooks run from a dumb or color-supporting terminal. So to avoid hard-to-read text, one has to disable colors in all cases.Behavior and configuration changes
The
color
option could support'auto'
string value.