-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-detect color
based on TERM
#591
Labels
feature request
A new lefthook feature description
Comments
Would love this. Currently I have to disable color everywhere if I want readable output in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
⚡ 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.The text was updated successfully, but these errors were encountered: