Pardon the SEO-optimized title but actually it doesn't look like more
can handle it at all.
Use less
:
cat FILE.json | jq . -C | less -R
jq . -C
:
-
'.' is the basic jq filter that pretty-prints JSON to stdout
-
-C : force
jq
to output ANSI color escape sequences ("ESC [... m") even when writing to a pipe
less -R
:
- Display ANSI color escape sequences on terminal.
I actually opened this gist with the hope of adapting your
more
version into working withless
😄Btw, I didn't know people still used
more
. I'd guess that mentioningless
gives better SEO.