-
Notifications
You must be signed in to change notification settings - Fork 47
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
Support disable color and switch off color when stdout is not a TTY #67
Conversation
I added a fake color render If it is ok for you, then I will complete this PR with more docs and test cases. @laike9m |
I don't have permission to edit doc in wiki so i put the doc in this description, you can copy it to wiki. and I don't mind if you squash merge, the commit log is a bit messy due to fixing the ci. @laike9m |
Let me know if I need to review |
@laike9m I applied you suggestions already, please review again and leave some comments if there is anything more need to be improved. |
pdir/configuration.py
Outdated
return False | ||
|
||
if ( | ||
_cfg.colorful_output is None or _cfg.colorful_output == "auto" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite sure where the default value is set, mind elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default value is None which has the same effect with "auto"
ready for review again, you can merge #68 first |
refactored some |
revert lock file. downgrade pdm tox. replace tox env upgrade tox-pdm gh-actions -> gh https://github.com/tox-dev/tox-gh#basic-example fix typo fix python version revert reinstall tox-gh-actions fix for tox-gh-actions fix dep
LGTM, thanks again! |
You can disable color output by setting
colorful-output = False
in~/.pdir2config
now.Example:
True
means always use color,False
means always disable color, andauto
means using color output when stdout is a TTY, otherwise not.You can also disable colors by environment variable
export PDIR2_NOCOLOR=1
. The environment has higher priority than the config file.close #65