-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Color in json.tool CLI #131952
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
Comments
cc @hugovk |
I think that adding colors by default can possibly break piping on some shells / systems. But, I am not 100% sure. Like |
By default, the Lines 109 to 112 in 3b3720f
Compare the output of |
I guess so. At least so-called cal does the same: ![]() |
The highlight includes the unprinted 0 prefix. |
@nineteendo thank you for taking the time to look into it. couple of notes: 1) unlike jq and python's json tool, i see your solution is not recursive (objects and arrays inside a json object are not nicely displayed, but everything is in one line) 2) i'm not a fan of that shade of bright blue |
That's because
I'm using the same colours as jq, this is just how Powershell renders them. |
Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Feature or enhancement
Proposal:
apologies if this is not the right place to ask for enhancement requests. since python3.13 added support for colorization in repl, i was wondering if some basic colorization could be added for the python's cli json tool? jq[0] does this, the keys are bolded and have a different color from the values.
if this gets implemented i think a lot of people will be happy to just use python and not have to install yet another library to fulfill their needs :-)
[0] https://static1.howtogeekimages.com/wordpress/wp-content/uploads/2020/01/5-7.png
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
json
CLI #132126The text was updated successfully, but these errors were encountered: