GeezerVison is showing github.com — No colors when hooks are run by a git commit · Issue #1381 · pre-commit/pre-commit
No colors when hooks are run by a git commit #1381
Description
Hi,
I use pre-commit at home on linux which works perfect. But at work I have a windows pc. Here I have problems with the colorfull output.
When the hooks are run by tox calling pre-commit run there are colors as usual. When the hooks are run by a git commit the colors are missing.
Concrete I mean the green for 'Passed', red for 'Failed ' and yellow/brown for 'Skipped' in the overview.
There is no difference if I run it via git-bash, cmd or powershell. Also there is no difference if I use the pycharm buildin terminal or others.
Activity
asottile commented on Apr 2, 2020
colors on windows are a bit fiddly and unfortunately there isn't much we can do to change them when run from git -- we try and call SetConsoleMode here but if that fails you don't get colors
Cielquan commented on Apr 2, 2020
Ok thanks for the fast answer.
Then I have to live with it :(
asottile commented on Apr 2, 2020
actually hmm, on windows sys.stdout.isatty() is false, but sys.stderr.isatty() is true -- which is different than linux, maybe if we use stderr instead of stdout?
Cielquan commented on Apr 2, 2020
When I run sys.std---.isatty() on my windows maschine both are false when run from pycharm python console. But both are true when run from the terminal regardless if via invoking a python console first or by running python -c.
asottile commented on Apr 2, 2020
can you try the patch in #1382?
Cielquan commented on Apr 2, 2020
Sure let me try .. may take a bit.
Cielquan commented on Apr 2, 2020
Metadata
Metadata
Development
No branches or pull requestsIssue actions